git.iko.soy/typeable/pandoc
on rc/2.8.1 help sign in
typeable/pandoc/test/lua/metatable-catch-all.lua
20 lines 354 B history raw
1local num_inlines = 0
3function catch_all(el)
4 if el.tag and pandoc.Inline.constructor[el.tag] then
5 num_inlines = num_inlines + 1
6 end
7end
9function Pandoc(blocks, meta)
10 return pandoc.Pandoc {
11 pandoc.Para{pandoc.Str(num_inlines)}
12 }
13end
15return {
16 setmetatable(
17 {Pandoc = Pandoc},
18 {__index = function(_) return catch_all end}
19 )