diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-11-02 17:21:29 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-11-02 17:23:24 +0100 |
commit | c467f0fed109c362faa733c1a258a26bc6aba5cd (patch) | |
tree | 940889e6da457d4665c21f69a992c33b49585876 /src | |
parent | 210e4c98b0d09dd8e25c108dda14fdb17ba90192 (diff) | |
download | pandoc-c467f0fed109c362faa733c1a258a26bc6aba5cd.tar.gz |
Lua: allow omitting the 2nd parameter in pandoc.Code constructor
Fixes a regression introduced in 2.15 which required users to always
specify an Attr value when constructing a Code element.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Pandoc.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 6d1ccea04..f09159b4e 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -138,9 +138,9 @@ inlineConstructors = <#> parameter peekInlinesFuzzy "content" "Inline" "placeholder content" =#> functionResult pushInline "Inline" "cite element" , defun "Code" - ### liftPure2 (flip Code) + ### liftPure2 (\text mattr -> Code (fromMaybe nullAttr mattr) text) <#> parameter peekText "code" "string" "code string" - <#> parameter peekAttr "attr" "Attr" "additional attributes" + <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" =#> functionResult pushInline "Inline" "code element" , mkInlinesConstr "Emph" Emph , defun "Image" |