From 07f41a5515c0d753c8b3fa074132ba219db8360c Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 14 Apr 2017 11:21:58 +0200 Subject: 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. --- test/lua/markdown-reader.lua | 3 +-- test/lua/plain-to-para.lua | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'test') 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, } } -- cgit v1.2.3