"मोड्युल:Redirect" का संशोधनहरू बिचको अन्तर

use mw.title.new, code by Galobtter and Rummskartoffel
(handle percent-encoding like MediaWiki does, from sandbox)
(use mw.title.new, code by Galobtter and Rummskartoffel)
return nil
end
end
 
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target and mw.uri.decode(target, 'PATH')
end
 
), 2)
end
if not titleObj or not titleObj.isRedirect then
return nil
end
local targetTitle = getTitle(target)titleObj.redirectTarget
if targetTitle then
-- Find the target by using string matching on the page content.
if fulltext then
local target = p.getTargetFromText(titleObj:getContent() or "")
return targetTitle.fullText
if target then
local targetTitle = getTitle(target)
if targetTitle then
if fulltext then
return targetTitle.fullText
else
return targetTitle.prefixedText
end
else
return niltargetTitle.prefixedText
end
else
return nil
-- The page is a redirect, but matching failed. This indicates a bug in
-- the redirect matching pattern, so throw an error.
error(string.format(
'could not parse redirect on page "%s"',
fulltext and titleObj.fullText or titleObj.prefixedText
))
end
end

edits

"https://ne.wikipedia.org/wiki/विशेष:MobileDiff/1049100" बाट अनुप्रेषित