<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Atitle%2FredirectTarget</id>
	<title>Module:title/redirectTarget - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Atitle%2FredirectTarget"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/redirectTarget&amp;action=history"/>
	<updated>2026-04-05T20:05:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:title/redirectTarget&amp;diff=474963&amp;oldid=prev</id>
		<title>Sware: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/redirectTarget&amp;diff=474963&amp;oldid=prev"/>
		<updated>2025-11-04T17:47:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:47, 4 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:title/redirectTarget&amp;diff=474962&amp;oldid=prev</id>
		<title>wikt&gt;Theknightwho at 13:03, 22 May 2025</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/redirectTarget&amp;diff=474962&amp;oldid=prev"/>
		<updated>2025-05-22T13:03:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local pcall = pcall&lt;br /&gt;
&lt;br /&gt;
local at_limit&lt;br /&gt;
&lt;br /&gt;
local function is_redirect(title)&lt;br /&gt;
	return title.isRedirect&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[==[&lt;br /&gt;
Returns the title object of the redirect target if title page is a redirect.&lt;br /&gt;
&lt;br /&gt;
Checking {title.redirectTarget} will transclude the title page, which may be undesirable when checking large numbers of titles. To avoid this, this function will attempt to check the {title.isRedirect} key first, only checking {title.redirectTarget} if it is confirmed that the title is a redirect. However, doing so will increment the expensive function count, which has a limit of 500. Once the limit has been reached, this function reverts to checking {title.redirectTarget} directly instead.&lt;br /&gt;
&lt;br /&gt;
The {force_transclusion} flag may be set to force the use of transclusion ({title.redirectTarget}) in all instances, which can be used to avoid incrementing the expensive function count; this is sometimes useful when making a large number of checks, as hitting the expensive function limit can be disruptive to other modules or templates.]==]&lt;br /&gt;
return function(title, force_transclusion)&lt;br /&gt;
	if not (force_transclusion or at_limit) then&lt;br /&gt;
		local success, result = pcall(is_redirect, title)&lt;br /&gt;
		if not success then&lt;br /&gt;
			at_limit = true&lt;br /&gt;
		elseif not result then&lt;br /&gt;
			return false&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local redirect = title.redirectTarget&lt;br /&gt;
	if not redirect then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	-- If the original title had a fragment, carry it over to the redirect.&lt;br /&gt;
	local fragment = title.fragment&lt;br /&gt;
	if fragment and fragment ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		redirect.fragment = fragment&lt;br /&gt;
	end&lt;br /&gt;
	return redirect&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>wikt&gt;Theknightwho</name></author>
	</entry>
</feed>