local utils = require 'pandoc.utils' local common = require 'scripts.lib.common' local vars = {} function meta(meta) vars = meta end function str(el) local prefix, varref, suffix = el.text:match('^(.*)%%([^ ]+)%%(.*)$') if varref then local parts = varref:split(".") local var = vars for i = 1, #parts do var = var[parts[i]] if not var then return el end end return pandoc.Str(prefix .. utils.stringify(var) .. suffix) end return el end return { { Meta = meta }, { Str = str } }