Module:Sandbox

local p = {}

function p.outputList (frame) local data = frame.args[1] local listTable = split( data, "," ) local list = "" local villagerList = "" local mainList = "" local listText = "" local listOutput = "" for k, list in ipairs(listTable) do       if list:match("%((.-)%)") then listText = list:match("(.+)%(")           list = frame:expandTemplate{ title = "Availability", args = { availabilityText, note = avail:match("%((.-)%)") } }        else        	listText = list            availability = frame:expandTemplate{ title = "Availability", args = { availabilityText } }        end        availabilityList = availabilityList .. availability    end

local root = mw.html.create root:wikitext(availabilityList) return root end