跳转到内容

模組:NumBlk2

本页使用了标题或全文手工转换
维基百科,自由的百科全书

这是本页的一个历史版本,由Justin545留言 | 贡献2025年4月27日 (日) 06:06 (加上log以記錄各個變數)编辑。这可能和当前版本存在着巨大的差异。

local p = {}

function p.fmtN(frame)
	local frame2 = frame:getParent()
	local code = frame.args[1]
	local code2 = mw.text.unstripNoWiki(code)
	local code3 = mw.ustring.gsub(
		code2, "%%(.)", function (ch)
			if (ch == "i") or (ch == "l") then
				return frame.args[ch]
			elseif ch == "L" then
				return "<";
			elseif ch == "G" then
				return ">";
			end
			return ch
		end
	)
	local ret = frame2:preprocess(code3)
	mw.log("code=" .. code .. "; code2=" .. code2 .. "; code3=" .. code3 .. "; ret=" .. ret .. ";")
	return ret
end

return p