Module:Test

local p = {} local function parse(line) local parsed = mw.text.split(mw.text.trim(line), "::") local code = mw.html.create('tr') local function generator(...) for i, v in ipairs(arg) do           code :tag('td') :wikitext(v) :done end end if parsed[1] == "M" and parsed[2] ~= nil then code :tag('td') :attr({           ['colspan'] = '5',            ['bgcolor'] = '230E29'        }) :css({           ["font-weight"] = "bold",            ["text-align"]  = "center"        }) :wikitext(parsed[2]) :done elseif parsed[1] == "T" and parsed[7] ~= nil then generator(           "[".."[Thread:"..parsed[2]..'|«'..parsed[3]..'»]]',            parsed[4],            "[".."[User:"..parsed[5].."|"..parsed[5].."]]",            parsed[6],            parsed[7]        ) elseif parsed[1] == "A" and parsed[6] ~= nil then generator(           "[".."[Thread:"..parsed[2]..'|«'..parsed[3]..'»]]',            parsed[4],            "Anonymous",            parsed[5],            parsed[6]        ) elseif parsed[1] == "D" and parsed[7] ~= nil then generator(           "[".."[Thread:"..parsed[2]..'|«'..parsed[3]..'»]]',            parsed[4],            parsed[5],            parsed[6],            parsed[7]        ) else code = '' end return code end function p.generate(frame) local head = { ["font-weight"] = "bold", ["text-align"] = "center", ["background-color"] = "#5F2C60" }   local result = mw.html.create('table') :css({           ["width"]       = "100%",            ["text-align"]  = "center",            ["font-family"] = "Trebuchet MS"        }) :addClass("wikitable") :tag('tr') :tag('td'):css(head):css("width", "33%") :wikitext("Title"):done :tag('td'):css(head):css("width", "8%") :wikitext("Messages"):done :tag('td'):css(head):css("width", "20%") :wikitext("Creator"):done :tag('td'):css(head):css("width", "21%") :wikitext("Created on"):done :tag('td'):css(head):css("width", "21%") :wikitext("Last posted on"):allDone for i, v in ipairs(frame.args) do      result:node( parse(v) ) end return tostring(result) end return p