Modulo:Tracce/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m specifico inizio e fine stringa |
test abbr |
||
(2 versioni intermedie di un altro utente non mostrate) | |||
Riga 22:
else
minuti = tonumber(args["Minuti" .. i])
secondi = args["Secondi" .. i] and mw.ustring.match(args["Secondi" .. i], "^%d%d?$") and
tonumber(args["Secondi" .. i]) end
local durata = (minuti or 0) * 60 + (secondi or 0)
Line 54 ⟶ 55:
table.insert(row_elements, titolo)
local featuring = args["Featuring" .. i]
if featuring then table.insert(row_elements, " <small>(<abbr title=featuring>feat.</abbr> " .. featuring .. ")</small>") end
local note = args["Note" .. i]
if note then table.insert(row_elements, " <small>(" .. note .. ")</small>") end
Line 229 ⟶ 230:
local args = {}
local log = {}
for k, v in pairs(pframe.args) do
if v ~= nil and v ~= '' then
if conversion_table[k] then -- Controlla se è un parametro non indicizzato args[conversion_table[k]] = v
else
-- estrae nome base e indice, se k=title1 allora prefix=title e num=1
local prefix, num = string.match(k, "^(%D+)(%d+)$")
if prefix and conversion_table_index[prefix] then -- controlla se è un parametro indicizzato
args[conversion_table_index[prefix] .. num] = v
elseif not num then -- non è neanche un parametro indicizzato, lo copia così com'è
args[k] = v
end
end
end
|