Difference between revisions of "Module:Redirect and target"
Jump to navigation
Jump to search
test>Rich Farmbrough ((Based on code by Jackmcbarn)) |
m (3 revisions imported) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 2: | Line 2: | ||
local p = {} | local p = {} | ||
| − | function p. | + | function p.line(frame) |
local pageTitle = frame.args[1] | local pageTitle = frame.args[1] | ||
local target = getTarget(pageTitle) | local target = getTarget(pageTitle) | ||
Latest revision as of 11:38, 7 September 2020
Documentation for this module may be created at Module:Redirect and target/doc
local getTarget = require('Module:Redirect').getTarget
local p = {}
function p.line(frame)
local pageTitle = frame.args[1]
local target = getTarget(pageTitle)
if target then
return string.format('[[%s]] → [[%s]]', pageTitle, target)
end
return string.format('[[%s]] is not a redirect', pageTitle)
end
return p