Skip to content

Commit 35930b9

Browse files
author
Alexander Krotov
committed
Change argument order of Lua Note constructor
1 parent bf39f45 commit 35930b9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

data/pandoc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,12 @@ M.InlineMath = M.Inline:create_constructor(
516516

517517
--- Creates a Note inline element
518518
-- @function Note
519-
-- @tparam "FootNote"|"EndNote" note type
520519
-- @tparam {Block,...} content note block content
520+
-- @tparam "FootNote"|"EndNote" note type
521521
M.Note = M.Inline:create_constructor(
522522
"Note",
523-
function(notetype, content) return {c = {notetype, List:new(content)}} end,
524-
{"notetype", "content"}
523+
function(content, notetype) return {c = {notetype, List:new(content)}} end,
524+
{"content", "notetype"}
525525
)
526526

527527
--- Creates a Quoted inline element given the quote type and quoted content.

src/Text/Pandoc/Lua/StackInstances.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pushInline = \case
243243
Image attr alt (src,tit) -> pushViaConstructor "Image" alt src tit (LuaAttr attr)
244244
LineBreak -> pushViaConstructor "LineBreak"
245245
Link attr lst (src,tit) -> pushViaConstructor "Link" lst src tit (LuaAttr attr)
246-
Note t blcks -> pushViaConstructor "Note" t blcks
246+
Note t blcks -> pushViaConstructor "Note" blcks t
247247
Math mty str -> pushViaConstructor "Math" mty str
248248
Quoted qt inlns -> pushViaConstructor "Quoted" qt inlns
249249
RawInline f cs -> pushViaConstructor "RawInline" f cs

src/Text/Pandoc/Writers/Custom.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ inlineToCustom (Link attr txt (src,tit)) =
231231
inlineToCustom (Image attr alt (src,tit)) =
232232
callFunc "Image" (Stringify alt) src tit (attrToMap attr)
233233

234-
inlineToCustom (Note FootNote contents) = callFunc "FootNote" (Stringify contents)
235-
236-
inlineToCustom (Note EndNote contents) = callFunc "EndNote" (Stringify contents)
234+
inlineToCustom (Note noteType contents) = callFunc "Note" (Stringify contents) noteType
237235

238236
inlineToCustom (Span attr items) =
239237
callFunc "Span" (Stringify items) (attrToMap attr)

0 commit comments

Comments
 (0)