Module:MediaCleaner

local p = {}

function p.clean(frame) local arg, media = frame:getParent.args[1], {} arg = string.gsub(arg, " ", "") -- Remove spaces local m = mw.text.split(arg, ",")

for _, l in ipairs(m) do media[l] = true end

if #media > 3 then if media.Anime or media.Manga then return "" end elseif #media == 3 and media.Manga then return "" else if media.Anime and media.Manga then return "" end if media.Anime then return "Anime" end if media.Manga then return "Manga" end end arg = string.gsub(string.gsub(arg, "%(", ""), "%)", "") return arg end

return p