git.iko.soy/typeable/pandoc
on master help sign in
Lua module: make Header argument order consistent

Attributes are always passed as the last element, making it possible to omit this argument. Argument order for `Header` was wrong and is fixed.

commit3362cb89d9034b84ec9504ff55ed0f79aa02f7e4 authorAlbert Krewinkel <albert@zeitkraut.de> dateSun 30 Apr 2017, 11:28 (9 years ago) parent01e8df2
2 files changed+3−3
data/pandoc.lua+2−2 src/Text/Pandoc/Lua/StackInstances.hs+1−1
data/pandoc.lua+2−2
@@ -265,12 +265,12 @@ M.Div = M.Block:create_constructor(
265265--- Creates a block quote element.
266266-- @function Header
267267-- @tparam int level header level
268−-- @tparam Attributes attributes element attributes
269268-- @tparam {Inline,...} content inline content
269+-- @tparam Attributes attributes element attributes
270270-- @treturn Block header element
271271M.Header = M.Block:create_constructor(
272272 "Header",
273− function(level, attributes, content)
273+ function(level, content, attributes)
274274 return {c = {level, attributes, content}}
275275 end,
276276 {"level", {"identifier", "classes", "attributes"}, "content"}
src/Text/Pandoc/Lua/StackInstances.hs+1−1
@@ -173,7 +173,7 @@ pushBlock lua = \case
173173 CodeBlock attr code -> pushViaConstructor lua "CodeBlock" code (LuaAttr attr)
174174 DefinitionList items -> pushViaConstructor lua "DefinitionList" items
175175 Div attr blcks -> pushViaConstructor lua "Div" blcks (LuaAttr attr)
176− Header lvl attr inlns -> pushViaConstructor lua "Header" lvl (LuaAttr attr) inlns
176+ Header lvl attr inlns -> pushViaConstructor lua "Header" lvl inlns (LuaAttr attr)
177177 HorizontalRule -> pushViaConstructor lua "HorizontalRule"
178178 LineBlock blcks -> pushViaConstructor lua "LineBlock" blcks
179179 OrderedList lstAttr list -> pushViaConstructor lua "OrderedList" list lstAttr