diff options
author | Volpeon <git@volpeon.ink> | 2022-07-10 11:23:10 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-07-10 11:23:10 +0200 |
commit | bce5fdfa3ab60ae443fd5ae32424826e9296f59a (patch) | |
tree | 2ed1502b7badda56502da8bb2bbab3238a616a60 /filters/lib | |
parent | Update (diff) | |
download | volpeon.ink-bce5fdfa3ab60ae443fd5ae32424826e9296f59a.tar.gz volpeon.ink-bce5fdfa3ab60ae443fd5ae32424826e9296f59a.tar.bz2 volpeon.ink-bce5fdfa3ab60ae443fd5ae32424826e9296f59a.zip |
Add support for custom emojis
Diffstat (limited to 'filters/lib')
-rw-r--r-- | filters/lib/common.lua | 13 |
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 |
26 | end | 26 | end |
27 | 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 | |||
28 | return { | 39 | return { |
29 | wide = wide | 40 | wide = wide, dump = dump |
30 | } | 41 | } |