Modulo:Navbox/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
test |
aggiornato alla versione corrente |
||
Riga 67:
return ret
end
-- Toglie eventuali spazi/a capo dannosi attorno ai {{,}}
local function trimSep(list)
local sep = mw.getCurrentFrame():expandTemplate{title=","}
local sepEsc = mw.ustring.gsub(sep, '-', '%-')
return mw.ustring.gsub(list, '%s*' .. sepEsc .. '%s*', sep)
end
Line 226 ⟶ 233:
-- listN
if self.args['list' .. id] then
local list = trimSep(self.args['list' .. id])
if (id % 2) == 0 then
altStyle = self.args.evenstyle
Line 242 ⟶ 250:
:cssText(altStyle)
:cssText(self.args['list' .. id .. 'style'])
:wikitext(
end
if id == 1 and self.args.image then
Line 302 ⟶ 310:
for _, id in ipairs(listIds) do
local trNode = self.tableNode:tag('tr')
local list = trimSep(self.args['list' .. id])
-- i groupN sono visibili solo se c'è la corrispettiva listN
if self.args['group' .. id] then
Line 319 ⟶ 328:
:cssText(self.args.liststyle)
:cssText(altStyle)
:wikitext(
end
end
|