Files
pandoc/pandoc-lua-engine/test/lua/metatable-catch-all.lua
Albert Krewinkel 5be9052f5f [API Change] Extract Lua code into new package pandoc-lua-engine
The flag 'lua53` must now be used with that package if pandoc is to be
compiled against Lua 5.3.
2022-09-30 08:33:40 -07:00

21 lines
354 B
Lua

local num_inlines = 0
function catch_all(el)
if el.tag and pandoc.Inline.constructor[el.tag] then
num_inlines = num_inlines + 1
end
end
function Pandoc(blocks, meta)
return pandoc.Pandoc {
pandoc.Para{pandoc.Str(num_inlines)}
}
end
return {
setmetatable(
{Pandoc = Pandoc},
{__index = function(_) return catch_all end}
)
}