跳转到内容

模組:Bulletin

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由Xiplus留言 | 贡献2018年2月13日 (二) 08:40 建立内容为“local p = {} function p.item( frame ) prefix = frame.args["prefix"] if prefix == nil then prefix = "" end suffix = frame.args[…”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

local p = {}

function p.item( frame )
	prefix = frame.args["prefix"]
    if prefix == nil then
    	prefix = ""
    end
    	
	suffix = frame.args["suffix"]
    if suffix == nil then
    	suffix = ""
    end
    	
	separator = frame.args["separator"]
    if separator == nil then
    	separator = "、"
    end
    
	conjunction = frame.args["conjunction"]
    if conjunction == nil then
    	conjunction = "及"
    end
    
    local items = {}
    local i = 1
	while frame.args[i] ~= nil do
		table.insert( items, frame.args[i] )
		i = i + 1
	end
	return prefix .. mw.text.listToText( items, separator, conjunction )
end

return p