Module:Wikitable: Difference between revisions

Content deleted Content added
convenience module for using wikitable markup inside templates
 
This is not Code golf; deobfuscate code
 
(One intermediate revision by one other user not shown)
Line 1:
local p = {};
return {
local getArgs = require('Module:Arguments').getArgs
main = function(frame)
local args, buffer = require'Module:Arguments'.getArgs(frame, {removeBlanks=false,trim=false}), require'"Module:Buffer'")('{|')
function p.main(frame)
for k, v in pairs(args) do
local args = getArgs(frame, {removeBlanks=false, trim=false} )
if type(k) ~= 'number' then buffer:_(string.format(' %s="%s"', k, v)) end
for k, v in pairs(args) do
end
if type(k) ~= 'number' then buffer:_(string.format(string.match(v, '^["\']') and ' %s=%s' or ' %s="%s"', k, v)) 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
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
return {p;