summaryrefslogtreecommitdiff
path: root/data/pandoc.lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-04-30 16:14:33 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2017-04-30 17:06:54 +0200
commitae21a8bb2a9d892491424f257ed0146c1b2affa2 (patch)
tree8bb96863bb27bedf1e4891a232af2ee46b561f3a /data/pandoc.lua
parent1afdccfa8c8a228187441e83bcc8e5214be3a8c8 (diff)
Lua filter: fall-back to global filters when none is returned
The implicitly defined global filter (i.e. all element filtering functions defined in the global lua environment) is used if no filter is returned from a lua script. This allows to just write top-level functions in order to define a lua filter. E.g function Emph(elem) return pandoc.Strong(elem.content) end
Diffstat (limited to 'data/pandoc.lua')
-rw-r--r--data/pandoc.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 31e46637c..2a5a945b5 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -803,7 +803,7 @@ end
function M.global_filter()
local res = {}
for k, v in pairs(_G) do
- if M.Inline.constructor[k] or M.Block.constructor[k] or M.Block.constructors[k] or k == "Doc" then
+ if M.Inline.constructor[k] or M.Block.constructor[k] or k == "Doc" then
res[k] = v
end
end