Module:Redirect: Difference between revisions
Content added Content deleted
Enwikipedia>Jackmcbarn (add p.getTargetFromText) |
Enwikipedia>SiBr4 (Moved from sandbox: making the isRedirect function available from other modules, like the main function is) |
||
Line 95: | Line 95: | ||
end |
end |
||
-- Returns |
-- Returns true if the specified page is a redirect, and false otherwise. |
||
⚫ | |||
-- otherwise. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
if not titleObj then |
if not titleObj then |
||
return |
return false |
||
end |
end |
||
if titleObj.isRedirect then |
if titleObj.isRedirect then |
||
return true |
|||
else |
|||
return false |
|||
end |
|||
end |
|||
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes' |
|||
-- if the specified page is a redirect, and the blank string otherwise. |
|||
function p.isRedirect(frame) |
|||
⚫ | |||
if p.luaIsRedirect(args[1]) then |
|||
return 'yes' |
return 'yes' |
||
else |
else |