七日内新公告:全站维护公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:OuterList

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳转到导航 跳转到搜索
模块文档  [创建] [刷新]
local module = {}

function module.Simple(frame)
	local parent = frame:getParent()
	if (not frame.args[1]) and parent and mw.title.new(parent:getTitle()).namespace == 10 and parent.args[1] then
		frame = parent
	elseif frame.args[1] then
	else
		return ""
	end
	local Separator = frame.args["Separator"] or "\n"
	local Prefix = frame.args["Prefix"] or "* "
	local Suffix = frame.args["Suffix"] or ""
	
	local i = 1
	local items = { }
	while (frame.args[i]) do
		table.insert(items, frame.args[i])
		i = i + 1
	end
	
	local result = table.concat(items, Suffix .. Separator .. Prefix)
	if result then
		result = Prefix .. result .. Suffix
	end
	return frame:preprocess(result)
end

return module