From 2761a38e530735499f7ac0075b768feb101190a5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 12 Apr 2017 20:48:44 +0200 Subject: Lua filter: use destructured functions for inline filters Instead of taking the whole inline element, forcing users to destructure it themselves, the components of the elements are passed to the filtering functions. --- test/lua/strmacro.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/lua') diff --git a/test/lua/strmacro.lua b/test/lua/strmacro.lua index 1b28801be..40756a476 100644 --- a/test/lua/strmacro.lua +++ b/test/lua/strmacro.lua @@ -1,10 +1,11 @@ return { - { Str = function (inline) - if inline.c == "{{helloworld}}" then + { + Str = function (str) + if str == "{{helloworld}}" then return pandoc.Emph {pandoc.Str "Hello, World"} else - return inline + return pandoc.Str(str) end - end, + end, } } -- cgit v1.2.3