跳转到内容

模組:NumBlk2

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

这是本页的一个历史版本,由Justin545留言 | 贡献2025年2月2日 (日) 05:03 (加入對%L與%G轉換指示符的處理)编辑。这可能和当前版本存在着巨大的差异。

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
	)
	return frame2:preprocess(code3)
end

return p