aboutsummaryrefslogtreecommitdiff
path: root/test/lua/blocks-filter.lua
blob: 4e944e922d77c08e4d44ebb7f843fbdda64cd731 (plain)
1
2
3
4
5
6
7
8
function Blocks (blks)
  -- verify that this looks like a `pandoc.List`
  if not blks.find or not blks.map or not blks.filter then
    error("table doesn't seem to be an instance of pandoc.List")
  end
  -- return plain block containing the number of elements in the list
  return {pandoc.Plain {pandoc.Str(tostring(#blks))}}
end