672a4bdd1d
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 |
||
---|---|---|
.. | ||
module | ||
attr-test.lua | ||
block-count.lua | ||
blocks-filter.lua | ||
hello-world-doc.lua | ||
implicit-doc-filter.lua | ||
inlines-filter.lua | ||
markdown-reader.lua | ||
math.lua | ||
meta.lua | ||
metatable-catch-all.lua | ||
plain-to-para.lua | ||
script-name.lua | ||
single-to-double-quoted.lua | ||
smallcaps-title.lua | ||
smart-constructors.lua | ||
strmacro.lua | ||
undiv.lua | ||
uppercase-header.lua |