Module:ExistNotRedirect/sandbox

From blackwiki
< Module:ExistNotRedirect
Revision as of 03:35, 11 July 2020 by blackwiki>Psiĥedelisto (This module was copied from Module:ExistNotRedirect revision 905684347. See that page's history for copyright attribution.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:ExistNotRedirect/sandbox/doc

local p = {}


function p.main(args)
	local myArgs = mw.getCurrentFrame():getParent().args
	local myPageName = myArgs[1]
	if (myPageName == nil) or (myPageName == "") then
		return ""
	end

	local mypageTitle = mw.title.makeTitle("", myPageName)
	if mypageTitle.exists then
		if mypageTitle.isRedirect then
			return ""
		else
			return myPageName
		end
	end

	return ""

end

return p