Module:Automarkup: Difference between revisions

From The Goon Show Depository

en>Petr Matas
No edit summary
 
m (1 revision imported: Import from Wikipedia)
 
(No difference)

Latest revision as of 10:19, 12 September 2022

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	
	local templateArgs = { }
	for key, value in pairs(args) do
		if type(key) == "number" then
			templateArgs[2 * key - 1] = value
			templateArgs[2 * key] = frame:preprocess(value)
		else
			templateArgs[key] = value
		end
	end
	
	return frame:expandTemplate{ title = "Markup", args = templateArgs }
end

return p