Skip to content

Commit

Permalink
Change argument order of Lua Note constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Krotov committed Dec 30, 2017
1 parent 00c5549 commit 8c38331
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions data/pandoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,12 @@ M.InlineMath = M.Inline:create_constructor(

--- Creates a Note inline element
-- @function Note
-- @tparam "FootNote"|"EndNote" note type
-- @tparam {Block,...} content note block content
-- @tparam "FootNote"|"EndNote" note type
M.Note = M.Inline:create_constructor(
"Note",
function(notetype, content) return {c = {notetype, List:new(content)}} end,
{"notetype", "content"}
function(content, notetype) return {c = {notetype, List:new(content)}} end,
{"content", "notetype"}
)

--- Creates a Quoted inline element given the quote type and quoted content.
Expand Down
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Lua/StackInstances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pushInline = \case
Image attr alt (src,tit) -> pushViaConstructor "Image" alt src tit (LuaAttr attr)
LineBreak -> pushViaConstructor "LineBreak"
Link attr lst (src,tit) -> pushViaConstructor "Link" lst src tit (LuaAttr attr)
Note t blcks -> pushViaConstructor "Note" t blcks
Note t blcks -> pushViaConstructor "Note" blcks t
Math mty str -> pushViaConstructor "Math" mty str
Quoted qt inlns -> pushViaConstructor "Quoted" qt inlns
RawInline f cs -> pushViaConstructor "RawInline" f cs
Expand Down
4 changes: 1 addition & 3 deletions src/Text/Pandoc/Writers/Custom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ inlineToCustom (Link attr txt (src,tit)) =
inlineToCustom (Image attr alt (src,tit)) =
callFunc "Image" (Stringify alt) src tit (attrToMap attr)

inlineToCustom (Note FootNote contents) = callFunc "FootNote" (Stringify contents)

inlineToCustom (Note EndNote contents) = callFunc "EndNote" (Stringify contents)
inlineToCustom (Note noteType contents) = callFunc "Note" (Stringify contents) noteType

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

0 comments on commit 8c38331

Please sign in to comment.