Anonymous user
Module:List: Difference between revisions
simplify the type-property-checking code
(use nil) |
(simplify the type-property-checking code) |
||
Line 67:
root.css('margin-left', indent .. 'em')
end
-- 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.
if args['type'] and not args['type']:match('^%s*[1AaIi]%s*$') then▼
args['type'] = nil▼
if not listStyleType then
listStyleType = listType
end
end
Line 77 ⟶ 80:
list
.attr('start', args.start)
.attr('type',
.css('list-style-type',
.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.
.wikitext(table.concat(listItems))
|