跳转到内容

模組:Automarkup

维基百科,自由的百科全书

这是Module:Automarkup当前版本,由TongcyDai留言 | 贡献编辑于2019年5月30日 (四) 03:31 建立内容为“local p = {} function p.main(frame) local args = frame:getParent().args local templateArgs = { } for key, value in pairs(args) do if type(ke…”的新页面)。这个网址是本页该版本的固定链接。

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

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	
	local templateArgs = { }
	for key, value in pairs(args) do
		if type(key) == "number" then
			templateArgs[2 * key - 1] = value
			templateArgs[2 * key] = frame:preprocess(value)
		else
			templateArgs[key] = value
		end
	end
	
	return frame:expandTemplate{ title = "Markup", args = templateArgs }
end

return p