Jump to content

Module:Wikitable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Codehydro (talk | contribs) at 19:44, 30 July 2017 (make quote removal optional). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

return {
	main = function(frame)
		local args, buffer = require'Module:Arguments'.getArgs(frame, {removeBlanks=false,trim=false}), require'Module:Buffer''{|'
		for k, v in pairs(args) do
			if type(k) ~= 'number' then buffer:_(string.format(string.match(v, '^["\']') and ' %s=%s' or ' %s="%s"', k, v)) end
		end
		buffer:_'\n'
		for _, v in ipairs(args) do
			if not string.match(v, '^!') then buffer:_'|' end
			buffer:_(v)
		end
		return table.concat(buffer:_'\n|}')
	end
}