2,509
次編輯
小無編輯摘要 |
小無編輯摘要 |
||
第113行: | 第113行: | ||
end | end | ||
return text .. refreshLink | return text .. refreshLink | ||
end | |||
-- [*[https://en.wikipedia.org/wiki/Module:Separated_entries, 供养{{多行分离}}]*] | |||
local function separatedEntries(args) | |||
local compressSparseArray = require 'Module:TableTools'.compressSparseArray | |||
local separator = args.separator | |||
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space. | |||
and mw.text.decode(args.separator) or '' | |||
-- Discard values before the starting parameter. | |||
local start = tonumber(args.start) | |||
if start then | |||
for i = 1, start - 1 do args[i] = nil end | |||
end | |||
-- Discard named parameters. | |||
local values = compressSparseArray(args) | |||
return mw.text.listToText(values, separator, separator) | |||
end | end | ||
第123行: | 第139行: | ||
p.countdown = makeInvokeFunc(countdown) | p.countdown = makeInvokeFunc(countdown) | ||
p.purge = makeInvokeFunc(purge, {parentOnly = true}) | p.purge = makeInvokeFunc(purge, {parentOnly = true}) | ||
p.separatedEntries = makeInvokeFunc(separatedEntries) | |||
return p | return p |
次編輯