跳转到内容

Module:StorySim:修订间差异

添加635字节 、​ 2023年12月31日 (星期日)
无编辑摘要
(Small Patch)
SSF讨论 | 贡献
无编辑摘要
第168行: 第168行:
]]
]]


local function reco(str)
local function reco(_str)
    while true do
    while true do
      local s,e,c,t = string.find(str,'<color=(.-)>(.-)</color>');
      local s,e,c,t = string.find(_str,'<color=(.-)>(.-)</color>');
      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)
      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(str,'<size=(.-)>(.-)</size>');
      local s,e,c,t = string.find(_str,'<size=(.-)>(.-)</size>');
      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)
      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 str;
   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


WikiBuilder
329

个编辑