diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-12 20:48:44 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-04-12 20:48:44 +0200 |
commit | 2761a38e530735499f7ac0075b768feb101190a5 (patch) | |
tree | b0355d8f1550cf36f5ab1c26e9cf9f879f20245d /test/lua | |
parent | 624ccbd45e24b1862e32252b3a03af7ee652bd16 (diff) | |
download | pandoc-2761a38e530735499f7ac0075b768feb101190a5.tar.gz |
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.
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/strmacro.lua | 9 |
1 files changed, 5 insertions, 4 deletions
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, } } |