Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
debug
pseudo-ternary operator doesn't work with "and nil"
Line 11:
local function concatstrings(s)
local r = table.concat(s, '')
returnif r:match('^%s*$') andthen return nil or rend
return r
end
local function concatstyles(s)
local r = table.concat(s, ';')
whilefor r:match_, v in ipairs(';%s*;') do
rv = mw.ustringtext.gsubtrim(rv, ';"%s*;', ';'")
if not isblank(v) then r = r .. v .. ';' end
end
if isblank(r) then return nil end
return r:match('^%s*;%s*$') and nil or r
return r
end