Modulo:Citazione: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
fix spazio tra icona ed eventuale codice lingua; rimuovo categoria di errore obsoleta; prevedo formato "html" come da discussione
Riga 870:
===============================================================================]]
local function get_format(format, url)
if format:lower() == 'html' then
 
return ''
local try_format = format
ifelseif not is_set(try_formatformat) then
try_formatformat = mw.ustring.match(url, "^.*%.(.+)$" ) or ''
if not cfg.external_link_type[try_formatformat:lower()] then
try_formatformat = mw.ustring.match(try_formatformat, "^(.+)#.+$") or ''
if not cfg.external_link_type[try_formatformat:lower()] then
return ''
end
Riga 883:
 
-- Se il formato esterno è tra quelli previsti imita lo stile dei template {{PDF}} o {{doc}}
local f = cfg.external_link_type[try_formatformat:lower()]
if f then
return mw.ustring.format(' (<span style="font-weight: bolder; font-size:80%%"><abbr title="%s">%s</abbr></span>)', f.text, f.label)
else
table.insert( z.message_tail, { set_error('unknown_format', try_formatformat, true) } );
return mw.ustring.format(' (%s)', try_formatformat)
end
end
Riga 1 392:
else
local frame_lingue = {return_error='true'}
localfor commalingua =in mw.ustringtext.findgsplit(Language, ',', 1, true) do
local iterator = comma and
mw.text.gsplit(Language, ',', true) or
mw.ustring.gmatch(Language, "%S+")
for lingua in iterator do
lingua = mw.text.trim(lingua)
if lingua ~= '' then
frame_lingue[#frame_lingue+1] = lingua
end
end
if not comma and #frame_lingue > 1 then
table.insert( z.error_categories, 'Voci con modulo citazione e valori lingua da separare con virgola' )
end
if #frame_lingue > 1 or (#frame_lingue==1 and frame_lingue[1]:lower()~="it") then
Riga 1 600 ⟶ 1 593:
local text = Language_code .. tostring(fragment_citation)
--aggiungo l'icona per cita video
if config.CitationClass == "video" then text = cfg.messages['icon_video'] .. ' ' .. text end
if config.CitationClass == "audio" then text = cfg.messages['icon_audio'] .. ' ' .. text end
 
-- Now enclose the whole thing in a <span/> element