Modul:IsIn
Die Dokumentation für dieses Modul kann unter Modul:IsIn/doc erstellt werden
local isIn = {}
function isIn.checkTarget( frame )
local page = mw.title.getCurrentTitle()
local targetPage = args.page or args[ 1 ] or ''
targetPage = mw.text.trim( targetPage )
targetPage = mw.ustring.gsub( targetPage, '^' .. page.nsText .. ':', '' )
if targetPage == '' or targetPage == page.text then
return 'false'
end
targetPage = mw.title.new( targetPage, page.nsText )
if not targetPage.exists or targetPage.isRedirect then
-- disambiguation cannot be checked
return 'false'
else
return 'true'
end
end
return isIn