跳至內容

「Module:StorySim」:修訂間差異

移除 137 位元組 、​ 2023年12月15日 (星期五)
修复+优化
(创建页面,内容为“local p = {} local getArgs = require('Module:Arguments').getArgs local function getTextList(txt,add,mod) local t = {}; local isValid = false; for i in string.gmatch(txt .. add,mod) do isValid = isValid or (i ~= '') if isValid then table.insert(t,i);end end return t; end local function delbr(txt) local t = txt; while true do local a = string.sub(t,-4) if a ~= '<br>' then break;end t = string.s…”)
 
SSF對話 | 貢獻
(修复+优化)
第44行: 第44行:
    local _type;
    local _type;
    local isEmpty = true;
    local isEmpty = true;
    for i, v in ipairs(l) do
   local i = 0;
      -- Init
    for a,b in string.gmatch(string.sub(txt,2) .. '\n[','(.-)%](.-)%c%[') do
     local a = ''; -- name="伊洛" class="123"
      i = i + 1;
      local b = ''; --  知道了知道了。
-- local a = 'name="伊洛" class="123"''
      for _a, _b in string.gmatch(v, "%[(.-)%](.*)") do
      -- local b = '知道了知道了。'
       a = _a
      isEmpty = (b == '' or a == '/');
 
     if isEmpty then b = '<div class="addLine"></div>';end
       isEmpty = (_b == '');
       if isEmpty 
       then b = '<div class="addLine"></div>'
       else b = _b
       end
       -- tableHTML:wikitext(tostring(isEmpty))
     end
 
      local n = getParam(a,"name");
      local n = getParam(a,"name");
      if n then
      if n then
第69行: 第61行:
      end
      end


      if _type == 'talk' then node:wikitext(b)
      if _type == 'talk' then node:wikitext(b):done()
      elseif _type == 'think' then
      elseif _type == 'think' then
        if isEmpty then node:wikitext(b):done()
        if isEmpty then node:wikitext(b):done()
第76行: 第68行:
      else node:tag("span"):addClass("storyError"):wikitext(string.format("警告:无法识别类型名!(line=%d)",i)):done();
      else node:tag("span"):addClass("storyError"):wikitext(string.format("警告:无法识别类型名!(line=%d)",i)):done();
      end
      end
    
      if not isEmpty then node:wikitext('<br>') end
      if not isEmpty then node:wikitext('<br>') end
   end
end
end
end


WikiBuilder
321

次編輯