WikiBuilder
329
个编辑
无编辑摘要 |
无编辑摘要 |
||
第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 | ||
local | local s,_,c,t = string.find(str,'<indent=(.-)%%>(.*)'); | ||
if c then str = string.sub(str,1,s-1) .. string.format("<span class='Indented indent_%s' style='padding-left:%.3fem;'>",c,(tonumber(c)/5)) .. t .. "</span>" | |||
end | end | ||
return str; | |||
return | |||
end | end | ||