Jump to content

Module:Item

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Petr Matas (talk | contribs) at 02:32, 13 December 2015 (Created page with 'local p = {} function escape(str) return str:gsub("([|\\])", "\\%1") end function p.main(frame) local parent = frame:getParent() local result = '' for ke...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function escape(str)
	return str:gsub("([|\\])", "\\%1")
end

function p.main(frame)
	local parent = frame:getParent()
	
	local result = ''
	for key, value in pairs(parent.args) do
		result = result .. "|" .. escape(key) .. "|" .. escape(value)
	end
	
	return result;
end

return p