diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-14 11:21:58 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-14 11:34:44 +0200 |
commit | 07f41a5515c0d753c8b3fa074132ba219db8360c (patch) | |
tree | 54a2fdea10ea81694357d1f6a7884431490b287b /test | |
parent | 0516b5127c3674786f92c61f4131428ed3b8bd4b (diff) | |
download | pandoc-07f41a5515c0d753c8b3fa074132ba219db8360c.tar.gz |
Lua filter: use destructured functions for block filters
Filtering functions take element components as arguments instead of the
whole block elements. This resembles the way elements are handled in
custom writers.
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/markdown-reader.lua | 3 | ||||
-rw-r--r-- | test/lua/plain-to-para.lua | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/test/lua/markdown-reader.lua b/test/lua/markdown-reader.lua index 6356113ec..a72af5546 100644 --- a/test/lua/markdown-reader.lua +++ b/test/lua/markdown-reader.lua @@ -1,7 +1,6 @@ return { { - RawBlock = function (blk) - local format, content = unpack(blk.c) + RawBlock = function (format, content) if format == "markdown" then return pandoc.reader.markdown.read_block(content) else diff --git a/test/lua/plain-to-para.lua b/test/lua/plain-to-para.lua index 747257411..a11edbbe2 100644 --- a/test/lua/plain-to-para.lua +++ b/test/lua/plain-to-para.lua @@ -1,6 +1,6 @@ return { - { Plain = function (blk) - return pandoc.Para(blk.c) + { Plain = function (content) + return pandoc.Para(content) end, } } |