From b81cff435727429d3e37c44ef778f8874d773ad3 Mon Sep 17 00:00:00 2001
From: Albert Krewinkel <albert@zeitkraut.de>
Date: Mon, 21 Aug 2017 16:47:05 +0200
Subject: [PATCH] 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.
---
 data/pandoc.lua | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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