<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.coigame.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AFormat_link%2Fdoc</id>
	<title>Module:Format link/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.coigame.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AFormat_link%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://wiki.coigame.com/index.php?title=Module:Format_link/doc&amp;action=history"/>
	<updated>2026-04-22T11:15:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.coigame.com/index.php?title=Module:Format_link/doc&amp;diff=2573&amp;oldid=prev</id>
		<title>Thadius856: fix cats</title>
		<link rel="alternate" type="text/html" href="http://wiki.coigame.com/index.php?title=Module:Format_link/doc&amp;diff=2573&amp;oldid=prev"/>
		<updated>2022-01-22T12:05:06Z</updated>

		<summary type="html">&lt;p&gt;fix cats&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:05, 22 January 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;You can solve this error by providing appropriate parameters to &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt;, or you may want to ensure that a more descriptive error is provided by a downstream template or module when it would otherwise call &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt; with inadequate arguments.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;You can solve this error by providing appropriate parameters to &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt;, or you may want to ensure that a more descriptive error is provided by a downstream template or module when it would otherwise call &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt; with inadequate arguments.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Sandbox other||&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Modules]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&amp;lt;/includeonly&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;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;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/del&gt;&amp;lt;/includeonly&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:1.41:old-2572:rev-2573:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Thadius856</name></author>
	</entry>
	<entry>
		<id>http://wiki.coigame.com/index.php?title=Module:Format_link/doc&amp;diff=2572&amp;oldid=prev</id>
		<title>Thadius856: Creation</title>
		<link rel="alternate" type="text/html" href="http://wiki.coigame.com/index.php?title=Module:Format_link/doc&amp;diff=2572&amp;oldid=prev"/>
		<updated>2022-01-22T12:04:30Z</updated>

		<summary type="html">&lt;p&gt;Creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This module, migrated from origins in [[Module:Hatnote]], provides functionality for formatting links for display, including that powering the {{tl|format link}} template.&lt;br /&gt;
&lt;br /&gt;
It can pretty-format section links with the section symbol (&amp;quot;§&amp;quot;) and appropriate whitespace, it automatically escapes category and file names with the [[Wikipedia:Help:Colon trick|colon trick]], and includes functionality for italicizing the page or section name, and for detecting and categorizing results that produce [[Wikipedia:Red link|red links]].&lt;br /&gt;
&lt;br /&gt;
== Use from wikitext ==&lt;br /&gt;
The functions in this module cannot be used directly from #invoke, and must be used through templates instead. Please see [[Template:Format link]] for documentation on usage of that template. &lt;br /&gt;
&lt;br /&gt;
== Use from other Lua modules==&lt;br /&gt;
To load this module from another Lua module, use the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;local mFormatLink = require(&amp;#039;Module:Format link&amp;#039;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then use the functions as documented below.&lt;br /&gt;
&lt;br /&gt;
=== _formatLink ===&lt;br /&gt;
&amp;lt;pre&amp;gt;mFormatLink._formatLink{&lt;br /&gt;
    link = &amp;#039;Link&amp;#039;,&lt;br /&gt;
    display = &amp;#039;Display&amp;#039;,&lt;br /&gt;
    target = &amp;#039;Target&amp;#039;,&lt;br /&gt;
    italicizePage = true,&lt;br /&gt;
    italicizeSection = true,&lt;br /&gt;
    categorizeMissing = &amp;#039;Pages using formatted red links&amp;#039;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Formats &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt; as a wikilink. Categories and files are automatically escaped with the [[Wikipedia:Help:Colon trick|colon trick]], and links to sections are automatically formatted as &amp;#039;&amp;#039;page § section&amp;#039;&amp;#039;, rather than the MediaWiki default of &amp;#039;&amp;#039;page#section&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Several options modify the output:&lt;br /&gt;
* If the &amp;lt;var&amp;gt;display&amp;lt;/var&amp;gt; value is present, then it will be used as a display value. Any manual piping (using the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; magic word or similar) present in &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt; will be overridden by the &amp;lt;var&amp;gt;display&amp;lt;/var&amp;gt; value if present.&lt;br /&gt;
* If the &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; value is present, then it will override &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt; as a target, but the result will still be &amp;#039;&amp;#039;displayed&amp;#039;&amp;#039; using either the value from &amp;lt;var&amp;gt;display&amp;lt;/var&amp;gt;, or the result of formatting &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt;.&lt;br /&gt;
* If &amp;lt;var&amp;gt;italicizePage&amp;lt;/var&amp;gt; is true, then the page portion of the link is italicized if present.&lt;br /&gt;
* If &amp;lt;var&amp;gt;italicizeSection&amp;lt;/var&amp;gt; is true, then the section portion of the link is italicized if present.&lt;br /&gt;
* If &amp;lt;var&amp;gt;categorizeMissing&amp;lt;/var&amp;gt; is a non-empty string, then that value is used as a category name, and that category will be applied if the resulting target of the link (no matter whether through &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt; or through &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt;) doesn&amp;#039;t exist.&lt;br /&gt;
&lt;br /&gt;
;Examples:&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Foo#Bar&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Foo#Bar|Foo §&amp;amp;amp;nbsp;Bar]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Foo#Bar}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Baz&amp;#039;, display = &amp;#039;Qux&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Baz|Qux]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Baz|Qux}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Foo|Bar&amp;#039;, display = &amp;#039;Baz&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Foo|Baz]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Foo{{!}}Bar|Baz}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;#Foo&amp;#039;, target = &amp;#039;Example#Foo&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Example#Foo|§&amp;amp;amp;nbsp;Foo]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|#Foo||Example#Foo}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;The Lord of the Rings#Plot&amp;#039;, italicizePage = true}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:The Lord of the Rings#Plot|&amp;#039;&amp;#039;The Lord of the Rings&amp;#039;&amp;#039; §&amp;amp;amp;nbsp;Plot]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|The Lord of the Rings#Plot|italicizepage=true}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice&amp;#039;, italicizeSection = true}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|Cybercrime Prevention Act of 2012 §&amp;amp;amp;nbsp;&amp;#039;&amp;#039;Disini v. Secretary of Justice&amp;#039;&amp;#039;]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|italicizesection=true}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Nonexistent page&amp;#039;, categorizeMissing = &amp;#039;Example&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Nonexistent page]][[Category:Example]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Nonexistent page}}&lt;br /&gt;
: &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; inline&amp;gt;mFormatLink._formatLink{link = &amp;#039;Existing&amp;#039;, categorizeMissing = &amp;#039;Example&amp;#039;}&amp;lt;/syntaxhighlight&amp;gt; &amp;amp;rarr; &amp;lt;nowiki&amp;gt;[[:Existing]]&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; {{format link|Existing}}&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt; is used and neither a &amp;lt;var&amp;gt;link&amp;lt;/var&amp;gt; nor a &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; argument is provided, then the module will produce an error message instead of its usual output, as it &amp;#039;&amp;#039;cannot&amp;#039;&amp;#039; then produce valid output.&lt;br /&gt;
&lt;br /&gt;
You can solve this error by providing appropriate parameters to &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt;, or you may want to ensure that a more descriptive error is provided by a downstream template or module when it would otherwise call &amp;lt;var&amp;gt;_formatLink&amp;lt;/var&amp;gt; with inadequate arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Thadius856</name></author>
	</entry>
</feed>