Module:Redirect/sandbox: Difference between revisions

Content deleted Content added
only get args from #invoke directly
add an "isRedirect" function
Line 87:
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
return p.luaMain(args[1], args.bracket) or ''
end
 
-- Returns "yes" if the specified page is a redirect, and the blank string
-- otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
local titleObj = getTitle(args[1])
if not titleObj then
return ''
end
if titleObj.isRedirect then
return 'yes'
else
return ''
end
end