Modulo:Font to span: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
ulteriore sintassi per size, sperando che siano giuste le corrispondenze occhiometriche |
Completati i substype e relative casistiche |
||
Riga 1:
local p={};
function p.main(frame)
Line 6 ⟶ 4:
local substype
--substype per eventuale spostamento testo
if string.match(str, "<font[^>]+>%[
substype=
elseif string.match(str, "<font[^>]+>
substype=
elseif string.match(str, "<font[^>]+>%[[^%] ]+]<%/font>") then
return str; --solo link esterno SENZA TITOLO: il font colora il numero progressivo dall'esterno, lo span no; non ho trovato un modo per colorarlo con span interno.
end --negli altri casi i risultati sono equivalenti
--riduzione stringa al solo font di apertura
Line 94 ⟶ 92:
result="[[" .. wl1 .. "|" .. span .. wl1 .. "</span>]]"
end
elseif substype==2 then
l=string.sub(str,string.find(str, "%["),string.find(str, "]"))
l1=string.sub(l, 1, string.find(l, " "));
l2=string.sub(string.gsub(string.sub(l,string.find(wl, " "),string.find(wl, "]")), "%]", ""), 2)
result=l1 .. span ..l2 .. "</span>]"
end
|