git.iko.soy/typeable/pandoc
on master help sign in
data/pandoc.lua: Include Pandoc, Meta in implicit filters

Functions with a name that corresponds to an AST element are included in implicit pandoc filter, but both `Meta` and `Pandoc` were wrongly ignored till now.

commitb81cff435727429d3e37c44ef778f8874d773ad3 authorAlbert Krewinkel <albert@zeitkraut.de> dateMon 21 Aug 2017, 16:47 (9 years ago) parentd70b89c
1 file changed+6−1
data/pandoc.lua+6−1
data/pandoc.lua+6−1
@@ -804,8 +804,13 @@ end
804804-- -- return {{Str = Str}}
805805function M.global_filter()
806806 local res = {}
807+ function is_filter_function(k)
808+ return M.Inline.constructor[k] or
809+ M.Block.constructor[k] or
810+ k == "Meta" or k == "Doc" or k == "Pandoc"
811+ end
807812 for k, v in pairs(_G) do
808− if M.Inline.constructor[k] or M.Block.constructor[k] or k == "Doc" then
813+ if is_filter_function(k) then
809814 res[k] = v
810815 end
811816 end