Module:Test

-- local p = {} local getArgs = require("Dev:Arguments").getArgs

-- Remove one trailing newline, for parity with the tag. local function preformat(text) return " " .. text:gsub("\n$", ""):gsub("\n", " ") end

function p.main(frame) local args = getArgs(frame) local infobox = mw.html.create("infobox") :tag("title") :tag("default") :wikitext("Test") :done :done :tag("data") :tag("label") :wikitext("Some code") :done :tag("default") :newline :wikitext(preformat(args[1] or "")) :newline :done :done

return frame:preprocess(tostring(infobox)) end

return p