summaryrefslogtreecommitdiff
path: root/data/pandoc.lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-08-21 16:47:05 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2017-08-21 16:47:05 +0200
commitb81cff435727429d3e37c44ef778f8874d773ad3 (patch)
treebc7a064692ef55ae76a67e93f8bd907f56b3452c /data/pandoc.lua
parentd70b89c0d9f2636814fc85232b017751a5469f75 (diff)
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.
Diffstat (limited to 'data/pandoc.lua')
-rw-r--r--data/pandoc.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 138d8b59b..a7e381435 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -804,8 +804,13 @@ end
-- -- return {{Str = Str}}
function M.global_filter()
local res = {}
+ function is_filter_function(k)
+ return M.Inline.constructor[k] or
+ M.Block.constructor[k] or
+ k == "Meta" or k == "Doc" or k == "Pandoc"
+ end
for k, v in pairs(_G) do
- if M.Inline.constructor[k] or M.Block.constructor[k] or k == "Doc" then
+ if is_filter_function(k) then
res[k] = v
end
end