FANDOM


local dd = {}
 
local function formatTabs(text)
    text = text or ''
    text = mw.text.trim(text)
    local res = {}
    for i,v in ipairs(mw.text.split(text, '\n\n+')) do
        local dl, dd
        for i,v in ipairs(mw.text.split(v, '\n')) do
            local tab = mw.ustring.match(v, '^;%s*(.*)%s*:$')
            if tab then
                dl = dl or mw.html.create('dl'):addClass('skill-tabs')
                dl:tag('dt'):wikitext(tab):done()
                dd = dl:tag('dd'):newline()
            else
                v = mw.ustring.gsub(v, '^:', '')
                if dd then
                    dd:wikitext(v):newline()
                else
                    res[#res+1] = v
                end
            end
            mw.log(i, '|'..v..'|')
        end
        if dl then res[#res+1] = tostring(dl) end
    end
    return table.concat(res, '\n')
end
function dd.test(frame)
    return formatTabs(frame.args[1])
end
return dd

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.