Module:List: Difference between revisions

No change in size ,  10 years ago
fix ordered lists - had a stupid variable clash
Enwikipedia>Mr. Stradivarius
(simplify the type-property-checking code)
Enwikipedia>Mr. Stradivarius
(fix ordered lists - had a stupid variable clash)
Line 69:
-- Detect if the type attribute specified by args.type is using an invalid value, and if so try passing it as a list-style-type CSS property.
local listStyleType = args.list_style_type or args['list-style-type']
local listTypetypeAttr = args['type']
if listTypetypeAttr and not listTypetypeAttr:match('^%s*[1AaIi]%s*$') then
if not listStyleType then
listStyleType = listTypetypeAttr
listTypetypeAttr = nil
end
end
Line 80:
list
.attr('start', args.start)
.attr('type', listTypetypeAttr)
.css('list-style-type', listStyleType)
.cssText(args.list_style or args.ul_style or args.ol_style) -- ul_style and ol_style are included for backwards compatibility. No distinction is made for ordered or unordered lists.