Module:List:修订间差异

删除的内容 添加的内容
CaelLab-import​(留言 | 贡献)
huifu bei enwiki daoru dingti de banben (shangyiban zhwiki>Xiplus-abot)
标签:手工回退
CaelLab-import​(留言 | 贡献)
追加 concat/list_to_text 辅助函数(导入模板需要,本地补建)
 
第207行:
end
 
 
-- Local additions: concat / list_to_text helpers used by imported templates.
function p.concat(frame)
local args = frame.args
local sep = args.sep or ''
local trim = (args.trim or '1') ~= '0'
local parts = {}
for i, v in ipairs(args) do
if trim then v = mw.text.trim(v) end
if v ~= '' then parts[#parts + 1] = v end
end
return table.concat(parts, sep)
end
 
function p.list_to_text(frame)
local parts = {}
for i, v in ipairs(frame.args) do
v = mw.text.trim(v)
if v ~= '' then parts[#parts + 1] = v end
end
return mw.text.listToText(parts)
end
return p