Files
pandoc/pandoc-lua-engine/test/lua/single-to-double-quoted.lua
T
Albert Krewinkel 4cf6ddb027 Lua: allow returning a single filter from filter files
It is now possible to return a single filter from a filter file, e.g.

``` lua
-- Switch single- and double quotes
return {
  Quoted = function (q)
    elem.quotetype = elem.quotetype == 'SingleQuote'
      and 'DoubleQuote' or 'SingleQuote'
    return elem
  end
}

The filter must not contain numerical indexes, or it might be treated as
a list of filters.
2024-10-01 12:23:36 +02:00

9 lines
162 B
Lua

return {
Quoted = function (elem)
if elem.quotetype == "SingleQuote" then
elem.quotetype = "DoubleQuote"
end
return elem
end,
}