local common = require 'scripts.lib.common' local vars = {} function meta(meta) vars = meta end function str(el) if vars.build and vars.build.file_out:match(".xml$") then return el end local prefix, emojiref, suffix = el.text:match('^(.*):([^ ]+):(.*)$') if emojiref then local els = pandoc.List() els:insert(pandoc.Str(prefix)) els:insert(pandoc.Image(emojiref, "/assets/emojis/" .. emojiref .. ".png", emojiref, { class = 'o-emoji' })) els:insert(pandoc.Str(suffix)) return els end return el end return { { Meta = meta }, { Str = str } }