pandoc/test/lua
Albert Krewinkel 672a4bdd1d Lua filters: allow filtering of element lists (#6040)
Lists of Inline and Block elements can now be filtered via `Inlines` and
`Blocks` functions, respectively. This is helpful if a filter conversion
depends on the order of elements rather than a single element.

For example, the following filter can be used to remove all spaces
before a citation:

    function isSpaceBeforeCite (spc, cite)
      return spc and spc.t == 'Space'
       and cite and cite.t == 'Cite'
    end

    function Inlines (inlines)
      for i = #inlines-1,1,-1 do
        if isSpaceBeforeCite(inlines[i], inlines[i+1]) then
          inlines:remove(i)
        end
      end
      return inlines
    end

Closes: #6038
2020-01-15 14:26:00 -08:00
..
module Lua: add methods insert, remove, and sort to pandoc.List 2020-01-11 21:31:20 +01:00
attr-test.lua data/pandoc.lua: enable table-like behavior of attributes (#4080) 2017-11-20 09:37:40 -08:00
block-count.lua Text.Pandoc.Lua: support Inline and Block catch-alls 2017-08-22 23:30:48 +02:00
blocks-filter.lua Lua filters: allow filtering of element lists (#6040) 2020-01-15 14:26:00 -08:00
hello-world-doc.lua data/pandoc.lua: regularize constructors. 2017-06-29 17:08:59 +02:00
implicit-doc-filter.lua data/pandoc.lua: regularize constructors. 2017-06-29 17:08:59 +02:00
inlines-filter.lua Lua filters: allow filtering of element lists (#6040) 2020-01-15 14:26:00 -08:00
markdown-reader.lua Lua module: provide simple read format parser 2017-04-26 23:28:40 +02:00
math.lua Test Lua filter converting display math to inline math 2018-04-29 16:20:38 +03:00
meta.lua Lua filters: allow filtering of element lists (#6040) 2020-01-15 14:26:00 -08:00
metatable-catch-all.lua Text.Pandoc.Lua: respect metatable when getting filters 2017-08-22 22:56:51 +02:00
plain-to-para.lua Lua filter: revert to non-destructuring filters 2017-04-15 21:40:48 +02:00
script-name.lua Lua: register script name in global variable 2018-02-24 22:43:28 +01:00
single-to-double-quoted.lua Lua filters: Remove special treatment of Quoted, Math. 2017-06-29 15:47:27 +02:00
smallcaps-title.lua Lua filter: allow filtering of meta data only 2017-04-26 23:28:40 +02:00
smart-constructors.lua data/pandoc.lua: auto-fix nested constructor arguments 2019-01-13 17:14:10 +01:00
strmacro.lua Lua filter: revert to non-destructuring filters 2017-04-15 21:40:48 +02:00
undiv.lua Allow lua filters to return lists of elements 2017-09-24 12:04:15 -07:00
uppercase-header.lua Lua filters: preload text module (#4077) 2017-11-18 13:24:06 -08:00