diff options
Diffstat (limited to 'filters')
-rw-r--r-- | filters/lib/common.lua | 26 | ||||
-rw-r--r-- | filters/vars.lua | 2 |
2 files changed, 2 insertions, 26 deletions
diff --git a/filters/lib/common.lua b/filters/lib/common.lua index 4d44ff3..d6f92e0 100644 --- a/filters/lib/common.lua +++ b/filters/lib/common.lua | |||
@@ -12,30 +12,6 @@ function wide(el) | |||
12 | return els | 12 | return els |
13 | end | 13 | end |
14 | 14 | ||
15 | function dump(o) | ||
16 | if type(o) == 'table' then | ||
17 | local s = '{ ' | ||
18 | for k, v in pairs(o) do | ||
19 | if type(k) ~= 'number' then k = '"' .. k .. '"' end | ||
20 | s = s .. '[' .. k .. '] = ' .. dump(v) .. ',' | ||
21 | end | ||
22 | return s .. '} ' | ||
23 | else | ||
24 | return tostring(o) | ||
25 | end | ||
26 | end | ||
27 | |||
28 | function string.split(str, sep) | ||
29 | sep = sep or '%s' | ||
30 | |||
31 | local parts = pandoc.List() | ||
32 | |||
33 | for field, s in str:gmatch("([^" .. sep .. "]*)(" .. sep .. "?)") do | ||
34 | parts:insert(field) | ||
35 | if s == "" then return parts end | ||
36 | end | ||
37 | end | ||
38 | |||
39 | return { | 15 | return { |
40 | wide = wide, dump = dump | 16 | wide = wide |
41 | } | 17 | } |
diff --git a/filters/vars.lua b/filters/vars.lua index b0fa66c..99cedc4 100644 --- a/filters/vars.lua +++ b/filters/vars.lua | |||
@@ -1,4 +1,4 @@ | |||
1 | local common = require 'filters.lib.common' | 1 | local common = require 'scripts.lib.common' |
2 | 2 | ||
3 | local vars = {} | 3 | local vars = {} |
4 | 4 | ||