From bce5fdfa3ab60ae443fd5ae32424826e9296f59a Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 10 Jul 2022 11:23:10 +0200 Subject: Add support for custom emojis --- filters/vars.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'filters/vars.lua') diff --git a/filters/vars.lua b/filters/vars.lua index e60019e..b0fa66c 100644 --- a/filters/vars.lua +++ b/filters/vars.lua @@ -1,20 +1,11 @@ -local vars = {} - -function string.split(str, sep) - sep = sep or '%s' - - local parts = pandoc.List() +local common = require 'filters.lib.common' - for field, s in str:gmatch("([^" .. sep .. "]*)(" .. sep .. "?)") do - parts:insert(field) - if s == "" then return parts end - end -end +local vars = {} function meta(meta) vars = meta end function str(el) - local prefix, varref, suffix = el.text:match('^(.*)%%(.*)%%(.*)$') + local prefix, varref, suffix = el.text:match('^(.*)%%([^ ]+)%%(.*)$') if varref then local parts = varref:split(".") -- cgit v1.2.3-54-g00ecf