summaryrefslogtreecommitdiffstats
path: root/filters/lib
diff options
context:
space:
mode:
Diffstat (limited to 'filters/lib')
-rw-r--r--filters/lib/common.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/filters/lib/common.lua b/filters/lib/common.lua
index 7654eb9..4d44ff3 100644
--- a/filters/lib/common.lua
+++ b/filters/lib/common.lua
@@ -25,6 +25,17 @@ function dump(o)
25 end 25 end
26end 26end
27 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
28return { 39return {
29 wide = wide 40 wide = wide, dump = dump
30} 41}