From 44c4660a31fcb6034a7368a3596ab7a252a87ad4 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 25 Jul 2020 20:29:21 +0200 Subject: Lua filters: make attr argument optional in Table constructor This changes the Lua API. It is highly unlikely for this change to affect existing filters, since the documentation for the new Table constructor (and type) was incomplete and partly wrong before. The Lua API is now more consistent, as all constructors for elements with attributes now take attributes as the last parameter. --- data/pandoc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'data') diff --git a/data/pandoc.lua b/data/pandoc.lua index 340c2f46c..d031bf5d0 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -556,18 +556,18 @@ M.RawBlock = M.Block:create_constructor( --- Creates a table element. -- @function Table --- @tparam Attr attr attributes -- @tparam Caption caption table caption -- @tparam {ColSpec,...} colspecs column alignments and widths -- @tparam TableHead head table head -- @tparam {TableBody,..} bodies table bodies -- @treturn TableFoot foot table foot +-- @tparam[opt] Attr attr attributes M.Table = M.Block:create_constructor( "Table", - function(attr, caption, colspecs, head, bodies, foot) + function(caption, colspecs, head, bodies, foot, attr) return { c = { - attr, + ensureAttr(attr), caption, List:new(colspecs), head, -- cgit v1.2.3