Module:IsRedirect: Difference between revisions

From Dive Atlas
(Created page with "local i = {} function i.IsRedirect(frame) local pagename = frame.args[1]; if pagename == '' then return ''; end local page = mw.title.new(pagena...")
 
m (1 revision imported)
 
(No difference)

Latest revision as of 05:39, 25 August 2023

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

local i = {}
 
function i.IsRedirect(frame)
    local pagename = frame.args[1];
    if pagename == '' then
        return '';
    end
    
    local page = mw.title.new(pagename);
    if page.isRedirect then
        return 'yes';
    else
        return '';
    end
end
 
return i;