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.
This commit is contained in:
Albert Krewinkel
2017-04-26 23:28:40 +02:00
committed by Albert Krewinkel
parent c2567b2bd0
commit 24ef672132
4 changed files with 44 additions and 68 deletions
+2 -1
View File
@@ -2,7 +2,8 @@ return {
{
RawBlock = function (elem)
if elem.format == "markdown" then
return pandoc.reader.markdown.read_block(elem.text)
local pd = pandoc.read(elem.text, "markdown")
return pd.blocks[1]
else
return elem
end