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.
This commit is contained in:
Albert Krewinkel 2017-04-30 11:28:03 +02:00
parent 01e8df2e53
commit 3362cb89d9
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
2 changed files with 3 additions and 3 deletions

View file

@ -265,12 +265,12 @@ M.Div = M.Block:create_constructor(
--- Creates a block quote element.
-- @function Header
-- @tparam int level header level
-- @tparam Attributes attributes element attributes
-- @tparam {Inline,...} content inline content
-- @tparam Attributes attributes element attributes
-- @treturn Block header element
M.Header = M.Block:create_constructor(
"Header",
function(level, attributes, content)
function(level, content, attributes)
return {c = {level, attributes, content}}
end,
{"level", {"identifier", "classes", "attributes"}, "content"}

View file

@ -173,7 +173,7 @@ pushBlock lua = \case
CodeBlock attr code -> pushViaConstructor lua "CodeBlock" code (LuaAttr attr)
DefinitionList items -> pushViaConstructor lua "DefinitionList" items
Div attr blcks -> pushViaConstructor lua "Div" blcks (LuaAttr attr)
Header lvl attr inlns -> pushViaConstructor lua "Header" lvl (LuaAttr attr) inlns
Header lvl attr inlns -> pushViaConstructor lua "Header" lvl inlns (LuaAttr attr)
HorizontalRule -> pushViaConstructor lua "HorizontalRule"
LineBlock blcks -> pushViaConstructor lua "LineBlock" blcks
OrderedList lstAttr list -> pushViaConstructor lua "OrderedList" list lstAttr