Module:List: Difference between revisions

m
Changed protection settings for "Module:List": High-risk Lua module: Used in MediaWiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
m (1 revision imported: Import "Information Appliance" infobox template)
m (Changed protection settings for "Module:List": High-risk Lua module: Used in MediaWiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite)))
Line 40:
end
end
 
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
Line 51:
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
Line 59:
end
end
 
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
Line 96:
table.insert(data.items, item)
end
 
return data
end
Line 102:
function p.renderList(data)
-- Renders the list HTML.
 
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
 
-- Render the main div tag.
local root = mw.html.create('div')
Anonymous user