Module:Redirect-distinguish: Difference between revisions

m
15 revisions imported from wikipedia:Module:Redirect-distinguish: All aboard the import train again. Originally imported from English Wikipedia.
(Added check for example values)
m (15 revisions imported from wikipedia:Module:Redirect-distinguish: All aboard the import train again. Originally imported from English Wikipedia.)
 
(12 intermediate revisions by 7 users not shown)
Line 20:
end
local redirectTitle = mw.title.new(args[1])
local currentTitle = currentTitle or mw.title.getCurrentTitle()
if redirectTitle and redirectTitle.exists then
if
if not redirectTitle.isRedirect then
elseif not string.match(args[1], 'REDIRECT%d+') and not args[1] == 'TERM' thenor
args[1] = args[1] .. '[[Category:Articles with redirect hatnotes needing review]]'
args[1] == 'TERM' or
end
currentTitle.namespace ~= 0
elseif not string.match(args[1], 'REDIRECT%d+') and not args[1] == 'TERM' then
then
--do nothing
ifelseif not redirectTitle andor not redirectTitle.exists then
args[1] = args[1] .. '[[Category:Missing redirects]]'
if elseif not redirectTitle.isRedirect then
if string.find(redirectTitle:getContent(), '#invoke:RfD') then
args[1] = args[1] ..
'[[Category:Articles with redirect hatnotes impacted by RfD]]'
else
args[1] = args[1] ..
args[1] = args[1] .. '[[Category:Articles with redirect hatnotes needing review]]'
end
end
if not args[2] then
Line 38 ⟶ 49:
local redirect = table.remove(args, 1)
local text = string.format(
'"%s" redirects here. It is notNot to be confused with %s.',
redirect,
mHatlist.orList(mHatnote.formatPages(unpack(args)), true)
)
return mHatnote._hatnote(text)