diff options
Diffstat (limited to 'filters/emojis.lua')
-rw-r--r-- | filters/emojis.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/filters/emojis.lua b/filters/emojis.lua new file mode 100644 index 0000000..5eb9d4b --- /dev/null +++ b/filters/emojis.lua | |||
@@ -0,0 +1,17 @@ | |||
1 | local common = require 'filters.lib.common' | ||
2 | |||
3 | function Str(el) | ||
4 | local prefix, emojiref, suffix = el.text:match('^(.*):([^ ]+):(.*)$') | ||
5 | |||
6 | if emojiref then | ||
7 | local els = pandoc.List() | ||
8 | |||
9 | els:insert(pandoc.Str(prefix)) | ||
10 | els:insert(pandoc.Image(emojiref, "/emojis/" .. emojiref .. ".png", emojiref, { class = 'o-emoji' })) | ||
11 | els:insert(pandoc.Str(suffix)) | ||
12 | |||
13 | return els | ||
14 | end | ||
15 | |||
16 | return el | ||
17 | end | ||