Module:Sandbox/BrownHairedGirl/ExistNotRedirect

This is the current revision of this page, as edited by BrownHairedGirl (talk | contribs) at 17:23, 9 July 2019 (done). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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