local p = {}
function p.main(frame)
local args = frame:getParent().args
local result = {}
-- 從參數 1 開始,逐個讀取直到遇到空值
local i = 1
while args[i] ~= nil do
local value = args[i]
if value ~= '' and mw.text.trim(value) ~= '' then
local tag = string.format(
'<span style="background:#000; color:#FFF; font-size:85%%; border-radius:8px; padding:1px 6px; margin:0 2px; display:inline-block; text-align:center;">\'\'\'%s\'\'\'</span>',
mw.text.trim(value)
)
table.insert(result, tag)
end
i = i + 1
end
return table.concat(result, '')
end
return p