memory alpha
Module documentation ()

Module source

local p = {}

function p.main(title)
	local frame = mw.getCurrentFrame()
	local override = {
		['Wej Duj'] = 'wej Duj'
	}
	title = type(title) == 'string' and title or frame:getParent().args[1]
	title = frame:callParserFunction('#titleparts', title)
	title = mw.ustring.gsub(title, '^(.+) %(episode%)$', '%1')
	title = mw.ustring.gsub(title, '^(.+) %(podcast%)$', '%1')
	title = mw.ustring.gsub(title, '^(.+) %(aftershow%)$', '%1')
	title = mw.ustring.gsub(title, '^(.+) %(film%)$', '%1')
	title = override[title] or title
	return title
end

return p