Module:DamagePatch: Difference between revisions

Fix an issue where tabs were displayed in a wrong order
No edit summary
Tag: Reverted
(Fix an issue where tabs were displayed in a wrong order)
 
(7 intermediate revisions by the same user not shown)
Line 54: Line 54:
         :tag('div'):wikitext(old_table)
         :tag('div'):wikitext(old_table)


     old_content:tag('div'):wikitext(frame:preprocess(args.old))
     if args.old then
        old_content:tag('div'):wikitext(frame:preprocess(string.char(10) .. args.old))
    end


     local new_content = mw.html.create('div')
     local new_content = mw.html.create('div')
         :tag('div'):wikitext(new_table)
         :tag('div'):wikitext(new_table)
      
 
    new_content:tag('div'):wikitext(frame:preprocess(args.new))
     if args.new or args.old then
        new_content:tag('div'):wikitext(frame:preprocess(string.char(10) .. (args.new or args.old)))
    end


     local kr_date = 'KR (' .. args.date .. ')'
     local kr_date = 'KR (' .. args.date .. ')'


     local tabber = frame:expandTemplate{
     local tabber = frame:preprocess("<tabber>\\\\NA=".. tostring(old_content) .."\\\\".. kr_date .."=".. tostring(new_content) .."</tabber>")
        title = 'Tabber',
        args = {
            NA = tostring(old_content),
            [kr_date] = tostring(new_content)
        }
    }


     return tabber
     return tabber