WikiBuilder
329
个编辑
小 (Small Patch) |
小无编辑摘要 |
||
第168行: | 第168行: | ||
]] | ]] | ||
local function reco( | local function reco(_str) | ||
while true do | while true do | ||
local s,e,c,t = string.find( | local s,e,c,t = string.find(_str,'<color=(.-)>(.-)</color>'); | ||
if s then | if s then _str = string.sub(_str,1,s-1) .. "<span class='Colored color_" .. c .. "' style='color:" .. c .. ";'>" .. t .. "</span>" .. string.sub(_str,e+1) | ||
else break; | else break; | ||
end | end | ||
end | end | ||
while true do | while true do | ||
local s,e,c,t = string.find( | local s,e,c,t = string.find(_str,'<size=(.-)>(.-)</size>'); | ||
if s then | if s then _str = string.sub(_str,1,s-1) .. string.format("<span class='Sized size_%s' style='font-size:%.3fem;'>",c,(tonumber(c)/36)) .. t .. "</span>" .. string.sub(_str,e+1) | ||
else break; | else break; | ||
end | end | ||
end | end | ||
return | local start,size,ed = string.match(_str,'(.*)<indent=(.-)%>(.*)'); | ||
if ed then | |||
local inn,out = string.match(ed,'(.*)</indent>(.*)'); | |||
if inn then _str = start .. string.format("<span class='Indented indent_%s' style='padding-left:%.3fem;'>",size,(tonumber(size)/5)) .. inn .. '</span>' .. out; | |||
else _str = start .. string.format("<span class='Indented indent_%s' style='padding-left:%.3fem;'>",size,(tonumber(size)/5)) .. ed .. '</span>'; | |||
end | |||
-- _str = start .. "<span class='Indented indent_" .. size .. "' style='padding-left:" .. c .. "em;'>" .. t .. "</span>" .. ed; | |||
end | |||
return _str; | |||
end | end | ||