https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ARedirect%2Fsandbox%2FdocModule:Redirect/sandbox/doc - Revision history2025-06-08T04:15:06ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.4https://en.wikipedia.org/w/index.php?title=Module:Redirect/sandbox/doc&diff=1207771494&oldid=prev223.189.197.253 at 17:48, 15 February 20242024-02-15T17:48:53Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:48, 15 February 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 4:</td>
<td colspan="2" class="diff-lineno">Line 4:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The 'main' function of this module accepts the name of a single page. It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text. Its usage is <nowiki>{{#invoke:redirect|main|redirect-page-name}}</nowiki>.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The 'main' function of this module accepts the name of a single page. It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text. Its usage is <nowiki>{{#invoke:redirect|main|redirect-page-name}}</nowiki>.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The template normally neither takes nor gives square brackets, so to show the result <del style="font-weight: bold; text-decoration: none;">as </del>a link use <nowiki>[[{{#invoke:redirect|main|redirect-page-name}}]]</nowiki>. An error is produced if the redirect does not exist, but for versatility no error is given if the file is not a redirect (returns the original text) or if the file name is blank (returns blank).</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The template normally neither takes nor gives square brackets, so to show the result <ins style="font-weight: bold; text-decoration: none;">asyty</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> </ins>a link use <nowiki>[[{{#invoke:redirect|main|redirect-page-name}}]]</nowiki>. An error is produced if the redirect does not exist, but for versatility no error is given if the file is not a redirect (returns the original text) or if the file name is blank (returns blank).</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>However, if the parameter ''bracket'' is given a nonblank value, brackets will be passed on if present.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>However, if the parameter ''bracket'' is given a nonblank value, brackets will be passed on if present.</div></td>
</tr>
</table>223.189.197.253https://en.wikipedia.org/w/index.php?title=Module:Redirect/sandbox/doc&diff=582845203&oldid=prevWnt: ←Created page with '{{used in system}} {{Module rating|beta}} == Main function == The 'main' function of this module accepts the name of a single page. It determines if the page is...'2013-11-22T17:58:32Z<p><a href="/wiki/Wikipedia:AES" class="mw-redirect" title="Wikipedia:AES">←</a>Created page with '{{used in system}} {{Module rating|beta}} == Main function == The 'main' function of this module accepts the name of a single page. It determines if the page is...'</p>
<p><b>New page</b></p><div>{{used in system}}<br />
{{Module rating|beta}}<br />
== Main function ==<br />
The 'main' function of this module accepts the name of a single page. It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text. Its usage is <nowiki>{{#invoke:redirect|main|redirect-page-name}}</nowiki>.<br />
<br />
The template normally neither takes nor gives square brackets, so to show the result as a link use <nowiki>[[{{#invoke:redirect|main|redirect-page-name}}]]</nowiki>. An error is produced if the redirect does not exist, but for versatility no error is given if the file is not a redirect (returns the original text) or if the file name is blank (returns blank).<br />
<br />
However, if the parameter ''bracket'' is given a nonblank value, brackets will be passed on if present.<br />
<br />
===Examples===<br />
''See [[Module:Redirect/testcases]]''<br />
<br />
<nowiki>{{#invoke:redirect|main|WP:AFC}}</nowiki><br />
<br />
produces<br />
<br />
{{#invoke:redirect|main|WP:AFC}}<br />
<br />
<nowiki>{{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}</nowiki><br />
<br />
produces<br />
<br />
{{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}<br />
<br />
If the target isnt a redirect:<br />
<br />
<nowiki>{{#invoke:redirect|main|Wikipedia:Articles for deletion|}}</nowiki><br />
<br />
produces<br />
<br />
{{#invoke:redirect|main|Wikipedia:Articles for deletion|}}<br />
<br />
== Block function ==<br />
The 'block' function replaces redirects with the actual names of articles in text entered either directly (using the ''text='' parameter) or by specifying the name of an index page in the first unlabelled parameter. Because checking for redirects is [[WP:expensive]], it only checks a limited number of links, so a feature is given to start only after reaching a link with a particular name. There is also a feature to limit replacements to piped links (<nowiki>[[A|B]]</nowiki> or unpiped links, or to make a piped link when an unpiped link is changed. This allows it to be used to make limited substitutions in articles without disrupting the text.<br />
<br />
=== parameters ===<br />
* ''1 ='' provides the name of the page containing the multiple redirects to process. Ignored if ''text'' is specified.<br />
* ''text ='' (or unnamed first parameter) provides a text on which to do substitutions<br />
* ''2 ='' (or unnamed second parameter) specifies the name of a wikilink (given in its original form, perhaps a redirect) at which to begin substitutions.<br />
* ''pipe =''<br />
:* If omitted, all links are processed: <nowiki>[[A]] -> [[X]], [[A|B]] -> [[X|B]]</nowiki><br />
:* If ''no'', unpiped links are processed: <nowiki>[[A]] -> [[X]], [[A|B]] -> [[A|B]]</nowiki><br />
:* If ''yes'', piped links are processed: <nowiki>[[A]] -> [[A]], [[A|B]] -> [[X|B]]</nowiki><br />
:* If ''make'', all links are processed, pipes are added on rename if absent: <nowiki>[[A]] -> [[A|X]], [[A|B]] -> [[X|B]]</nowiki>. Note that ''make'' is the setting most practical for article text to be subsequently screened for duplicate wikilinks.<br />
* ''nowiki ='' (set to 'no' if some processing of the output is desired; usually you don't want this)<br />
<br />
=== examples ===<br />
See [[Module talk:Redirect/sandbox/testcases]]</div>Wnt