模块:Utils

来自Limbo Wiki

此模块的文档可以在模块:Utils/doc创建

local p = {} --啥都有。

function p.urlEncode(frame)
	local a = string.gsub(frame.args[1], "([^%w%.%- ])", 
		function(c)
			return string.format("%%%02X", string.byte(c))
		end
	)
	return a;
end

function p.ind(frame)
	f = mw.getCurrentFrame();
	f:extensionTag {
		name = "indicator",
		content = '<div class="Indicator" id="Indicator-' .. frame.args[1] ..'">' .. frame.args[2] .. "</div>",
		args = {name = frame.args[1]}
	};
	return;
end

return p