Module:MediaCleaner

local p = {}

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

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

if #media > 3 then if media.Anime or media.Manga then return "" end 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 return table.concat(media, ", ") end

return p