@@ -403,7 +403,7 @@ M.Null = M.Block:create_constructor(
403M.OrderedList = M.Block:create_constructor(
403M.OrderedList = M.Block:create_constructor(
404 "OrderedList",
404 "OrderedList",
405 function(items, listAttributes)
405 function(items, listAttributes)
406− listAttributes = listAttributes or {1, M.DefaultStyle, M.DefaultDelim}
406+ listAttributes = listAttributes or M.ListAttributes()
407 return {c = {listAttributes, ensureList(items)}}
407 return {c = {listAttributes, ensureList(items)}}
409 {{listAttributes = {"start", "style", "delimiter"}}, "content"}
409 {{listAttributes = {"start", "style", "delimiter"}}, "content"}
@@ -857,6 +857,34 @@ function M.Citation:new (id, mode, prefix, suffix, note_num, hash)
861+M.ListAttributes = AstElement:make_subtype 'ListAttributes'
863+--- Creates a set of list attributes.
864+-- @function ListAttributes
865+-- @tparam[opt] integer start number of the first list item
866+-- @tparam[opt] string style style used for list numbering
867+-- @tparam[opt] DefaultDelim|Period|OneParen|TwoParens delimiter delimiter of list numbers
868+-- @treturn table list attributes table
869+function M.ListAttributes:new (start, style, delimiter)
871+ style = style or 'DefaultStyle'
872+ delimiter = delimiter or 'DefaultDelim'
873+ return {start, style, delimiter}
875+M.ListAttributes.behavior._field_names = {start = 1, style = 2, delimiter = 3}
876+M.ListAttributes.behavior.__index = function (t, k)
877+ return rawget(t, getmetatable(t)._field_names[k]) or
880+M.ListAttributes.behavior.__newindex = function (t, k, v)
881+ if getmetatable(t)._field_names[k] then
882+ rawset(t, getmetatable(t)._field_names[k], v)
861------------------------------------------------------------------------
889------------------------------------------------------------------------
862-- Constants
890-- Constants