Module:RfD: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
add somewhere to put Rcats and such
Jackmcbarn (talk | contribs)
simplify again using Module:Redirect
Line 1:
local p = {}
 
local getTargetFromText
 
-- called if the redirect up for discussion is being transcluded
p['1'] = function(frame)
if not getTargetFromText then
return frame:getParent():preprocess(mw.title.new(frame.args[1]):getContent())
getTargetFromText = require('Module:Redirect').getTargetFromText
end
return frame:getParent():preprocess(mw.title.new(getTargetFromText(frame.args[12])):getContent())
end
 
-- called if the redirect up for discussion is being viewed
p[''] = function(frame)
return frame.args[3] .. '\n\n#REDIRECT [[' .. frame.args[1] .. ']]\n' .. frame.args[2]
end