Changes
add fix to make the start parameter work with horizontal ordered lists, and switch to Module:Arguments for argument processing
local p = {}
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local function getArgNums(args)
-- Returns an array containing the keys of all positional arguments -- that contain data (i.e. non-whitespace values).
local nums = {}
for k, v in pairs(args) do
-- Build the list tags and list items.
local list = root.tag((listType == 'ordered' or listType == 'horizontal_ordered') and 'ol' or 'ul')
local start = args.start
list
.attr('start', start)
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(start)
if startNum then
list.css('counter-reset', 'listitem ' .. tostring(startNum - 1))
end
end
list
.attr('type', typeAttr)
.css('list-style-type', listStyleType)
local function makeWrapper(listType)
return function(frame)
local origArgs if frame args == mw.getCurrentFramegetArgs() thenframe, { origArgs valueFunc = frame:getParentfunction ().args for kkey, v in pairs(frame.argsvalue) do origArgs = frame.args break end else origArgs = frame end local args = {} for k, v in pairs(origArgs) do if type(kkey) == 'number' or v value ~= '' then return value args[k] = vend
end
return p.makeList(listType, args)
end