Modulo:Font to span: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix
+size in pt
Riga 5:
local function extract(x)
face=string.match(x, "face%s*=%s*([%d%aæ]+)") or string.match(x, 'face%s*=%s*"%s*([^"]+)"')
size=string.match(x, 'size%s*=%s*"?%s*([-+]?%d+[pxempxtem%%]*)"?') or string.match(x, 'size%s*=%s*"?%s*([%a-]+)"?')
color=string.match(x, 'color%s*=%s*"?%s*(rgb%([^)]+%))"?') or string.match(x, 'color%s*=%s*"?%s*(#?%w+)"?')
style=string.match(x, 'style%s*=%s*"([^"]+)"')
Riga 29:
if type=="size" then
--riporto valori fantasiosi di size a quelli reali
elseif z>4 and if string.match(a, "^%d+%d$ *pt") then a="+4" end
z=tonumber(a)
z=string.match(a, "(%d+)")
if z~=nil then
a=math.floor(z * 4 / 3) .. "px"
if z>7 then a="7"
else
elseif z<-2 then a="-2"
z=tonumber(a)
elseif z>4 and string.match(a, "^%+%d$") then a="+4" end
if z~=nil then
if z>7 then a="7"
elseif z<-2 then a="-2"
elseif z>4 and string.match(a, "^%+%d$") then a="+4" end
end
end
--tabella conversione size