Module:List: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(add support for start and type attributes in ordered lists)
(add support for horizontal numbered lists)
Line 40: Line 40:
local function getClass(listType, class)
local function getClass(listType, class)
local classes = {}
local classes = {}
if listType == 'horizontal' then
if listType == 'horizontal' or listType == 'horizontal_numbered' then
table.insert(classes, 'hlist')
table.insert(classes, 'hlist')
elseif listType == 'unbulleted' then
elseif listType == 'unbulleted' then
Line 86: Line 86:
local listTag = 'ul'
local listTag = 'ul'
local startAttr, typeAttr
local startAttr, typeAttr
if listType == 'numbered' then
if listType == 'numbered' or listType == 'horizontal_numbered' then
listTag = 'ol'
listTag = 'ol'
startAttr = args.start
startAttr = args.start
Line 133: Line 133:
end
end


local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'numbered'}
local funcNames = {'bulleted', 'unbulleted', 'horizontal', 'numbered', 'horizontal_numbered'}


for _, funcName in ipairs(funcNames) do
for _, funcName in ipairs(funcNames) do