Module:Item

From escforumwiki
Revision as of 02:32, 13 December 2015 by en>Petr Matas (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...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Item/doc

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