https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ARedirect%2Fsandbox%2Fdoc Module:Redirect/sandbox/doc - Revision history 2025-06-08T04:15:06Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.4 https://en.wikipedia.org/w/index.php?title=Module:Redirect/sandbox/doc&diff=1207771494&oldid=prev 223.189.197.253 at 17:48, 15 February 2024 2024-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 &lt;nowiki&gt;{{#invoke:redirect|main|redirect-page-name}}&lt;/nowiki&gt;.</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 &lt;nowiki&gt;{{#invoke:redirect|main|redirect-page-name}}&lt;/nowiki&gt;.</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 &lt;nowiki&gt;[[{{#invoke:redirect|main|redirect-page-name}}]]&lt;/nowiki&gt;. 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 &lt;nowiki&gt;[[{{#invoke:redirect|main|redirect-page-name}}]]&lt;/nowiki&gt;. 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.253 https://en.wikipedia.org/w/index.php?title=Module:Redirect/sandbox/doc&diff=582845203&oldid=prev Wnt: ←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 &#039;{{used in system}} {{Module rating|beta}} == Main function == The &#039;main&#039; function of this module accepts the name of a single page. It determines if the page is...&#039;</p> <p><b>New page</b></p><div>{{used in system}}<br /> {{Module rating|beta}}<br /> == Main function ==<br /> The &#039;main&#039; 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 &lt;nowiki&gt;{{#invoke:redirect|main|redirect-page-name}}&lt;/nowiki&gt;.<br /> <br /> The template normally neither takes nor gives square brackets, so to show the result as a link use &lt;nowiki&gt;[[{{#invoke:redirect|main|redirect-page-name}}]]&lt;/nowiki&gt;. 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 &#039;&#039;bracket&#039;&#039; is given a nonblank value, brackets will be passed on if present.<br /> <br /> ===Examples===<br /> &#039;&#039;See [[Module:Redirect/testcases]]&#039;&#039;<br /> <br /> &lt;nowiki&gt;{{#invoke:redirect|main|WP:AFC}}&lt;/nowiki&gt;<br /> <br /> produces<br /> <br /> {{#invoke:redirect|main|WP:AFC}}<br /> <br /> &lt;nowiki&gt;{{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}&lt;/nowiki&gt;<br /> <br /> produces<br /> <br /> {{#invoke:redirect|main|[[WP:AFD]]|bracket=yes}}<br /> <br /> If the target isnt a redirect:<br /> <br /> &lt;nowiki&gt;{{#invoke:redirect|main|Wikipedia:Articles for deletion|}}&lt;/nowiki&gt;<br /> <br /> produces<br /> <br /> {{#invoke:redirect|main|Wikipedia:Articles for deletion|}}<br /> <br /> == Block function ==<br /> The &#039;block&#039; function replaces redirects with the actual names of articles in text entered either directly (using the &#039;&#039;text=&#039;&#039; 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 (&lt;nowiki&gt;[[A|B]]&lt;/nowiki&gt; 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 /> * &#039;&#039;1 =&#039;&#039; provides the name of the page containing the multiple redirects to process. Ignored if &#039;&#039;text&#039;&#039; is specified.<br /> * &#039;&#039;text =&#039;&#039; (or unnamed first parameter) provides a text on which to do substitutions<br /> * &#039;&#039;2 =&#039;&#039; (or unnamed second parameter) specifies the name of a wikilink (given in its original form, perhaps a redirect) at which to begin substitutions.<br /> * &#039;&#039;pipe =&#039;&#039;<br /> :* If omitted, all links are processed: &lt;nowiki&gt;[[A]] -&gt; [[X]], [[A|B]] -&gt; [[X|B]]&lt;/nowiki&gt;<br /> :* If &#039;&#039;no&#039;&#039;, unpiped links are processed: &lt;nowiki&gt;[[A]] -&gt; [[X]], [[A|B]] -&gt; [[A|B]]&lt;/nowiki&gt;<br /> :* If &#039;&#039;yes&#039;&#039;, piped links are processed: &lt;nowiki&gt;[[A]] -&gt; [[A]], [[A|B]] -&gt; [[X|B]]&lt;/nowiki&gt;<br /> :* If &#039;&#039;make&#039;&#039;, all links are processed, pipes are added on rename if absent: &lt;nowiki&gt;[[A]] -&gt; [[A|X]], [[A|B]] -&gt; [[X|B]]&lt;/nowiki&gt;. Note that &#039;&#039;make&#039;&#039; is the setting most practical for article text to be subsequently screened for duplicate wikilinks.<br /> * &#039;&#039;nowiki =&#039;&#039; (set to &#039;no&#039; if some processing of the output is desired; usually you don&#039;t want this)<br /> <br /> === examples ===<br /> See [[Module talk:Redirect/sandbox/testcases]]</div> Wnt