Modulo:Tracce/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix local
categoria d'errore per markup di corsivo/grassetto quando il corsivo è automatico; per disattivare il corsivo di un titolo esiste il parametro "CorsivoN"
Riga 1:
local categories = {}
local missing_title = '[[Categoria:Errori di compilazione del template Tracce - titolo mancante]]'
local unexpected_markup = '[[Categoria:Errori di compilazione del template Tracce - markup inaspettato]]'
local unknown_format = '[[Categoria:Errori di compilazione del template Tracce - formato durata sconosciuto]]'
 
-- Protects a string that will be wrapped in wiki italic markup '' ... ''
local function safeforitalics( str )
if str ~= nil and str ~= '' then
--[[ Note: We can not use <i> for italics, as the expected behavior for
if str:sub(1,1) == "'" then str = "<span></span>" .. str; end
italics specified by ''...'' in the title is that they will be inverted
if str:sub(-1,-1) == "'" then str = str .. "<span></span>"; end
(i.e. unitalicized) in the resulting references. ]]
elseend
 
if str == nil or str == :find("''") then
categories[#categories+1] = unexpected_markup
return str;
else
if str:sub(1,1) == "'" then str = "<span></span>" .. str; end
if str:sub(-1,-1) == "'" then str = str .. "<span></span>"; end
return str;
end
return str;
end