「モジュール:List」の版間の差分
コード修正。モジュール:List/sandboxの2021年12月13日 (月) 00:33(JST)の版から。
en>Wugapodes 細 (Changed protection settings for "Module:List": High-risk Lua module: Used in MediaWiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))) |
ja>STS2657 (コード修正。モジュール:List/sandboxの2021年12月13日 (月) 00:33(JST)の版から。) |
||
| 69行目: | 69行目: | ||
-- Start number for ordered lists | -- Start number for ordered lists | ||
data.start = args.start | data.start = args.start | ||
if listType == 'horizontal_ordered' then | if listType == 'ordered' or listType == 'horizontal_ordered' then | ||
-- Apply fix to get start numbers working with horizontal ordered lists. | -- Apply fix to get start numbers working with horizontal ordered lists. | ||
local startNum = tonumber(data.start) | local startNum = tonumber(data.start) | ||
if startNum then | if startNum then | ||
data.counterReset = 'listitem ' .. tostring(startNum - 1 | data.counterReset = 'listitem ' .. tostring(startNum) | ||
data.counterIncrement = 'listitem -1' | |||
end | end | ||
end | end | ||
| 94行目: | 95行目: | ||
item.value = args['item' .. tostring(num) .. '_value'] | item.value = args['item' .. tostring(num) .. '_value'] | ||
or args['item_value' .. tostring(num)] | or args['item_value' .. tostring(num)] | ||
if item.value ~= nil then | |||
item.style = 'counter-reset: listitem ' .. item.value .. ';counter-increment: none;' .. ((item.style) or '') | |||
end | |||
table.insert(data.items, item) | table.insert(data.items, item) | ||
end | end | ||
| 124行目: | 128行目: | ||
:css{ | :css{ | ||
['counter-reset'] = data.counterReset, | ['counter-reset'] = data.counterReset, | ||
['counter-increment'] = data.counterIncrement, | |||
['list-style-type'] = data.listStyleType | ['list-style-type'] = data.listStyleType | ||
} | } | ||