Module:List: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
use nil |
simplify the type-property-checking code |
||
Line 67: | Line 67: | ||
root.css('margin-left', indent .. 'em') |
root.css('margin-left', indent .. 'em') |
||
end |
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. |
|||
⚫ | |||
local listStyleType = args.list_style_type or args['list-style-type'] |
|||
local listType = args['type'] |
|||
⚫ | |||
⚫ | |||
if not listStyleType then |
|||
listStyleType = listType |
|||
⚫ | |||
end |
end |
||
end |
end |
||
Line 77: | Line 80: | ||
list |
list |
||
.attr('start', args.start) |
.attr('start', args.start) |
||
.attr('type', |
.attr('type', listType) |
||
.css('list-style-type', |
.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. |
.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)) |
.wikitext(table.concat(listItems)) |