pandoc/test/lua/markdown-reader.lua
Albert Krewinkel 24ef672132 Lua module: provide simple read format parser
A single `read` function parsing pandoc-supported formats is added to
the module. This is simpler and more convenient than the previous method
of exposing all reader functions individually.
2017-04-26 23:28:40 +02:00

12 lines
222 B
Lua

return {
{
RawBlock = function (elem)
if elem.format == "markdown" then
local pd = pandoc.read(elem.text, "markdown")
return pd.blocks[1]
else
return elem
end
end,
}
}