Module:Category

local p = {}

function formatAvailability(availability) end

function p.availabilityCategory (frame) local data = frame.args[1] local availabilityTable = split( data, "," ) local availability = "" local availabilityList = "" local mainAvailability = "" local availabilityText = "" local availabilityOutput = "" for k, avail in ipairs(availabilityTable) do       if avail:match("%((.-)%)") then availabilityText = avail:match("(.+)%("):gsub("^%s*(.-)%s*$", "%1")       	if availabilityText == "Unobtainable" then        		availability = ''        		if frame.args['game'] == "DnM" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "DnM+" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "PG" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "DnMe+" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "iQue" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "WW" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "CF" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "NL" then        			availability = availablity .. ' '        		elseif frame.args['game'] == "HHD" then availability = availablity .. ' '       		elseif frame.args['game'] == "PC" then availability = availablity .. ' '       		elseif frame.args['game'] == "NH" then availability = availablity .. ' '       		end else availability = '' end else availabilityText = avail:gsub("^%s*(.-)%s*$", "%1") if availabilityText == "Unobtainable" then availability = '' if frame.args['game'] == "DnM" then availability = availablity .. ' '       		elseif frame.args['game'] == "DnM+" then availability = availablity .. ' '       		elseif frame.args['game'] == "PG" then availability = availablity .. ' '       		elseif frame.args['game'] == "DnMe+" then availability = availablity .. ' '       		elseif frame.args['game'] == "iQue" then availability = availablity .. ' '       		elseif frame.args['game'] == "WW" then availability = availablity .. ' '       		elseif frame.args['game'] == "CF" then availability = availablity .. ' '       		elseif frame.args['game'] == "NL" then availability = availablity .. ' '       		elseif frame.args['game'] == "HHD" then availability = availablity .. ' '       		elseif frame.args['game'] == "PC" then availability = availablity .. ' '       		elseif frame.args['game'] == "NH" then availability = availablity .. ' '       		end else availability = '' end end availabilityList = availabilityList .. string.gsub(availability, "\s+$", "") end

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

return p