summaryrefslogtreecommitdiffstats
path: root/filters/lib
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-08-02 20:56:45 +0200
committerVolpeon <git@volpeon.ink>2022-08-02 20:56:45 +0200
commit944a735c39a27fc86569c585f2805837b61adb60 (patch)
treec35f9e0c834c35a395aa58edbcebd8b5e9c83d70 /filters/lib
parentStyle fix for card list 'list' layout gap on <=sm (diff)
downloadvolpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.tar.gz
volpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.tar.bz2
volpeon.ink-944a735c39a27fc86569c585f2805837b61adb60.zip
Slightly tidied up metadata handling
Diffstat (limited to 'filters/lib')
-rw-r--r--filters/lib/common.lua26
1 files changed, 1 insertions, 25 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}