Modulo:Font to span: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Sbozzo modulo
 
+ricavo e pulizia parametri del tag. +ToDo per riprendere il lavoro la prossima settimana
Riga 5:
function p.main(frame)
str=(mw.ustring.gsub(frame.args[1], "{{=}}", "="))
local substype
 
if string.match(str, "<font[^>]+>[^%[]+<%/font>") then
returnsubstype=0; " --testo semplice"
elseif string.match(str, "<font[^>]+>%[%[[^%]]+]]<%/font>") then
returnsubstype=1; " --testo +wl"
else
return "no match"str;
end
n=string.find(str, ">")
s=string.sub(str,1,n)
 
face=string.match(s, "face=%a+")
if face==nil then face=string.match(s, 'face="[%a ]+"') end
if face~=nil then face=string.gsub(string.sub(face, 6), '"', "") end
 
size=string.match(s, "size=%d")
if size==nil then size=string.match(s, 'size="?%[-+]?%d+[ px]*"?') end
if size~=nil then size=string.gsub(string.sub(size, 6), '"', "") end
 
color=string.match(s, 'color="?#?[a-f0-9]+"?')
if color==nil then color=string.match(s, 'color="?%a+"?') end
if color~=nil then color=string.gsub(string.sub (color, 7), '"', "") end
 
style=string.match(s, 'style="[^"]+"')
if style~=nil then style=string.gsub(string.sub (style, 7), '"', "") end
 
--conversione size da tabella
--controllo colore (aggiunge # se necessario)
--se style ha già uno o più degli altri 3 parametri, eliminare questi ultimi incriminati (comanda style)
--concatenare tutto in style e ricomporre la stringa
--eventuali spostamenti del tag all'interno di quadre con substype + altri eventuali casi
--riconsegnare il risultato
 
-- +pagina di appoggio con sintassi nominale per evitare beghe di conversione dell'uguale
 
end