summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
Diffstat (limited to 'filters')
-rw-r--r--filters/lib/common.lua26
-rw-r--r--filters/vars.lua2
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
13end 13end
14 14
15function 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
26end
27
28function 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
37end
38
39return { 15return {
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 @@
1local common = require 'filters.lib.common' 1local common = require 'scripts.lib.common'
2 2
3local vars = {} 3local vars = {}
4 4