<?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%3AHatnote</id>
	<title>Module:Hatnote - 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%3AHatnote"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Hatnote&amp;action=history"/>
	<updated>2026-04-06T01:34:30Z</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:Hatnote&amp;diff=477568&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:Hatnote&amp;diff=477568&amp;oldid=prev"/>
		<updated>2025-11-15T11:44:31Z</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 11:44, 15 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:Hatnote&amp;diff=477567&amp;oldid=prev</id>
		<title>w&gt;Ahecht: Revert</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Hatnote&amp;diff=477567&amp;oldid=prev"/>
		<updated>2025-03-18T15:47:33Z</updated>

		<summary type="html">&lt;p&gt;Revert&lt;/p&gt;
&lt;a href=&quot;https://linguifex.com/w/index.php?title=Module:Hatnote&amp;amp;diff=477567&amp;amp;oldid=229952&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>w&gt;Ahecht</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:Hatnote&amp;diff=229952&amp;oldid=prev</id>
		<title>Sware at 16:44, 3 July 2021</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Hatnote&amp;diff=229952&amp;oldid=prev"/>
		<updated>2021-07-03T16:44:32Z</updated>

		<summary type="html">&lt;p&gt;&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 16:44, 3 July 2021&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-l283&quot;&gt;Line 283:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 283:&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;	checkType(&amp;#039;_hatnote&amp;#039;, 2, options, &amp;#039;table&amp;#039;, true)&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;	checkType(&amp;#039;_hatnote&amp;#039;, 2, options, &amp;#039;table&amp;#039;, true)&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;div&gt;	options = options or {}&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;	options = options or {}&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;	local classes = {&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use_with_mention&lt;/del&gt;&#039;, &#039;navigation-not-searchable&#039;}&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;	local classes = {&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use-with-mention&lt;/ins&gt;&#039;, &#039;navigation-not-searchable&#039;}&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;div&gt;	local extraclasses = options.extraclasses&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;	local extraclasses = options.extraclasses&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;div&gt;	local selfref = options.selfref&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;	local selfref = options.selfref&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:Hatnote&amp;diff=229951&amp;oldid=prev</id>
		<title>Sware at 16:44, 3 July 2021</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Hatnote&amp;diff=229951&amp;oldid=prev"/>
		<updated>2021-07-03T16:44:17Z</updated>

		<summary type="html">&lt;p&gt;&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 16:44, 3 July 2021&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-l283&quot;&gt;Line 283:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 283:&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;	checkType(&amp;#039;_hatnote&amp;#039;, 2, options, &amp;#039;table&amp;#039;, true)&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;	checkType(&amp;#039;_hatnote&amp;#039;, 2, options, &amp;#039;table&amp;#039;, true)&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;div&gt;	options = options or {}&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;	options = options or {}&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;	local classes = {&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hatnote&lt;/del&gt;&#039;, &#039;navigation-not-searchable&#039;}&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;	local classes = {&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use_with_mention&lt;/ins&gt;&#039;, &#039;navigation-not-searchable&#039;}&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;div&gt;	local extraclasses = options.extraclasses&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;	local extraclasses = options.extraclasses&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;div&gt;	local selfref = options.selfref&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;	local selfref = options.selfref&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:Hatnote&amp;diff=229948&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;-------------------------------------------------------------------------------- --                              Module:Hatnote                                -- --...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Hatnote&amp;diff=229948&amp;oldid=prev"/>
		<updated>2021-07-03T16:36:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-------------------------------------------------------------------------------- --                              Module:Hatnote                                -- --...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                              Module:Hatnote                                --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module produces hatnote links and links to related articles. It       --&lt;br /&gt;
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --&lt;br /&gt;
-- helper functions for other Lua hatnote modules.                            --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local libraryUtil = require(&amp;#039;libraryUtil&amp;#039;)&lt;br /&gt;
local checkType = libraryUtil.checkType&lt;br /&gt;
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg&lt;br /&gt;
local mArguments -- lazily initialise [[Module:Arguments]]&lt;br /&gt;
local yesno -- lazily initialise [[Module:Yesno]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function getArgs(frame)&lt;br /&gt;
	-- Fetches the arguments from the parent frame. Whitespace is trimmed and&lt;br /&gt;
	-- blanks are removed.&lt;br /&gt;
	mArguments = require(&amp;#039;Module:Arguments&amp;#039;)&lt;br /&gt;
	return mArguments.getArgs(frame, {parentOnly = true})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function removeInitialColon(s)&lt;br /&gt;
	-- Removes the initial colon from a string, if present.&lt;br /&gt;
	return s:match(&amp;#039;^:?(.*)&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.findNamespaceId(link, removeColon)&lt;br /&gt;
	-- Finds the namespace id (namespace number) of a link or a pagename. This&lt;br /&gt;
	-- function will not work if the link is enclosed in double brackets. Colons&lt;br /&gt;
	-- are trimmed from the start of the link by default. To skip colon&lt;br /&gt;
	-- trimming, set the removeColon parameter to false.&lt;br /&gt;
	checkType(&amp;#039;findNamespaceId&amp;#039;, 1, link, &amp;#039;string&amp;#039;)&lt;br /&gt;
	checkType(&amp;#039;findNamespaceId&amp;#039;, 2, removeColon, &amp;#039;boolean&amp;#039;, true)&lt;br /&gt;
	if removeColon ~= false then&lt;br /&gt;
		link = removeInitialColon(link)&lt;br /&gt;
	end&lt;br /&gt;
	local namespace = link:match(&amp;#039;^(.-):&amp;#039;)&lt;br /&gt;
	if namespace then&lt;br /&gt;
		local nsTable = mw.site.namespaces[namespace]&lt;br /&gt;
		if nsTable then&lt;br /&gt;
			return nsTable.id&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatPages(...)&lt;br /&gt;
	-- Formats a list of pages using formatLink and returns it as an array. Nil&lt;br /&gt;
	-- values are not allowed.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for i, page in ipairs(pages) do&lt;br /&gt;
		ret[i] = p._formatLink{link = page}&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatPageTables(...)&lt;br /&gt;
	-- Takes a list of page/display tables and returns it as a list of&lt;br /&gt;
	-- formatted links. Nil values are not allowed.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local links = {}&lt;br /&gt;
	for i, t in ipairs(pages) do&lt;br /&gt;
		checkType(&amp;#039;formatPageTables&amp;#039;, i, t, &amp;#039;table&amp;#039;)&lt;br /&gt;
		local link = t[1]&lt;br /&gt;
		local display = t[2]&lt;br /&gt;
		links[i] = p._formatLink{link = link, display = display}&lt;br /&gt;
	end&lt;br /&gt;
	return links&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)&lt;br /&gt;
	-- Formats an error message to be returned to wikitext. If&lt;br /&gt;
	-- addTrackingCategory is not false after being returned from&lt;br /&gt;
	-- [[Module:Yesno]], and if we are not on a talk page, a tracking category&lt;br /&gt;
	-- is added.&lt;br /&gt;
	checkType(&amp;#039;makeWikitextError&amp;#039;, 1, msg, &amp;#039;string&amp;#039;)&lt;br /&gt;
	checkType(&amp;#039;makeWikitextError&amp;#039;, 2, helpLink, &amp;#039;string&amp;#039;, true)&lt;br /&gt;
	yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
	title = title or mw.title.getCurrentTitle()&lt;br /&gt;
	-- Make the help link text.&lt;br /&gt;
	local helpText&lt;br /&gt;
	if helpLink then&lt;br /&gt;
		helpText = &amp;#039; ([[&amp;#039; .. helpLink .. &amp;#039;|help]])&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		helpText = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- Make the category text.&lt;br /&gt;
	local category&lt;br /&gt;
	if not title.isTalkPage -- Don&amp;#039;t categorise talk pages&lt;br /&gt;
		and title.namespace ~= 2 -- Don&amp;#039;t categorise userspace&lt;br /&gt;
		and yesno(addTrackingCategory) ~= false -- Allow opting out&lt;br /&gt;
	then&lt;br /&gt;
		category = &amp;#039;Hatnote templates with errors&amp;#039;&lt;br /&gt;
		category = string.format(&lt;br /&gt;
			&amp;#039;[[%s:%s]]&amp;#039;,&lt;br /&gt;
			mw.site.namespaces[14].name,&lt;br /&gt;
			category&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		category = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s%s.&amp;lt;/strong&amp;gt;%s&amp;#039;,&lt;br /&gt;
		msg,&lt;br /&gt;
		helpText,&lt;br /&gt;
		category&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.disambiguate(page, disambiguator)&lt;br /&gt;
	-- Formats a page title with a disambiguation parenthetical,&lt;br /&gt;
	-- i.e. &amp;quot;Example&amp;quot; → &amp;quot;Example (disambiguation)&amp;quot;.&lt;br /&gt;
	checkType(&amp;#039;disambiguate&amp;#039;, 1, page, &amp;#039;string&amp;#039;)&lt;br /&gt;
	checkType(&amp;#039;disambiguate&amp;#039;, 2, disambiguator, &amp;#039;string&amp;#039;, true)&lt;br /&gt;
	disambiguator = disambiguator or &amp;#039;disambiguation&amp;#039;&lt;br /&gt;
	return string.format(&amp;#039;%s (%s)&amp;#039;, page, disambiguator)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Format link&lt;br /&gt;
--&lt;br /&gt;
-- Makes a wikilink from the given link and display values. Links are escaped&lt;br /&gt;
-- with colons if necessary, and links to sections are detected and displayed&lt;br /&gt;
-- with &amp;quot; § &amp;quot; as a separator rather than the standard MediaWiki &amp;quot;#&amp;quot;. Used in&lt;br /&gt;
-- the {{format link}} template.&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.formatLink(frame)&lt;br /&gt;
	-- The formatLink export function, for use in templates.&lt;br /&gt;
	yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local link = args[1]&lt;br /&gt;
	if not link then&lt;br /&gt;
		return p.makeWikitextError(&lt;br /&gt;
			&amp;#039;no link specified&amp;#039;,&lt;br /&gt;
			&amp;#039;Template:Format link#Errors&amp;#039;,&lt;br /&gt;
			args.category&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return p._formatLink{&lt;br /&gt;
		link = link,&lt;br /&gt;
		display = args[2],&lt;br /&gt;
		italicizePage = yesno(args.italicizepage),&lt;br /&gt;
		italicizeSection = yesno(args.italicizesection),&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function italicize(s)&lt;br /&gt;
	-- Italicize a string.&lt;br /&gt;
	return &amp;#039;&amp;lt;i&amp;gt;&amp;#039; .. s .. &amp;#039;&amp;lt;/i&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function maybeItalicize(s, shouldItalicize)&lt;br /&gt;
	-- italicize s if s is a string and the shouldItalicize parameter is true.&lt;br /&gt;
	if s and shouldItalicize then&lt;br /&gt;
		return italicize(s)&lt;br /&gt;
	else&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parseLink(link)&lt;br /&gt;
	-- Parse a link and return a table with the link&amp;#039;s components.&lt;br /&gt;
	-- These components are:&lt;br /&gt;
	-- - link: the link, stripped of any initial colon (always present)&lt;br /&gt;
	-- - page: the page name (always present)&lt;br /&gt;
	-- - section: the page name (may be nil)&lt;br /&gt;
	-- - display: the display text, if manually entered after a pipe (may be nil)&lt;br /&gt;
	link = removeInitialColon(link)&lt;br /&gt;
&lt;br /&gt;
	-- Find whether a faux display value has been added with the {{!}} magic&lt;br /&gt;
	-- word.&lt;br /&gt;
	local prePipe, display = link:match(&amp;#039;^(.-)|(.*)$&amp;#039;)&lt;br /&gt;
	link = prePipe or link&lt;br /&gt;
&lt;br /&gt;
	-- Find the page, if it exists.&lt;br /&gt;
	-- For links like [[#Bar]], the page will be nil.&lt;br /&gt;
	local preHash, postHash = link:match(&amp;#039;^(.-)#(.*)$&amp;#039;)&lt;br /&gt;
	local page&lt;br /&gt;
	if not preHash then&lt;br /&gt;
		-- We have a link like [[Foo]].&lt;br /&gt;
		page = link&lt;br /&gt;
	elseif preHash ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		-- We have a link like [[Foo#Bar]].&lt;br /&gt;
		page = preHash&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the section, if it exists.&lt;br /&gt;
	local section&lt;br /&gt;
	if postHash and postHash ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		section = postHash&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return {&lt;br /&gt;
		link = link,&lt;br /&gt;
		page = page,&lt;br /&gt;
		section = section,&lt;br /&gt;
		display = display,&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._formatLink(options)&lt;br /&gt;
	-- The formatLink export function, for use in modules.&lt;br /&gt;
	checkType(&amp;#039;_formatLink&amp;#039;, 1, options, &amp;#039;table&amp;#039;)&lt;br /&gt;
	checkTypeForNamedArg(&amp;#039;_formatLink&amp;#039;, &amp;#039;link&amp;#039;, options.link, &amp;#039;string&amp;#039;, false)&lt;br /&gt;
	checkTypeForNamedArg(&lt;br /&gt;
		&amp;#039;_formatLink&amp;#039;,&lt;br /&gt;
		&amp;#039;display&amp;#039;,&lt;br /&gt;
		options.display,&lt;br /&gt;
		&amp;#039;string&amp;#039;,&lt;br /&gt;
		true&lt;br /&gt;
	)&lt;br /&gt;
	checkTypeForNamedArg(&lt;br /&gt;
		&amp;#039;_formatLink&amp;#039;,&lt;br /&gt;
		&amp;#039;italicizePage&amp;#039;,&lt;br /&gt;
		options.italicizePage,&lt;br /&gt;
		&amp;#039;boolean&amp;#039;,&lt;br /&gt;
		true&lt;br /&gt;
	)&lt;br /&gt;
	checkTypeForNamedArg(&lt;br /&gt;
		&amp;#039;_formatLink&amp;#039;,&lt;br /&gt;
		&amp;#039;italicizeSection&amp;#039;,&lt;br /&gt;
		options.italicizeSection,&lt;br /&gt;
		&amp;#039;boolean&amp;#039;,&lt;br /&gt;
		true&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
	local parsed = parseLink(options.link)&lt;br /&gt;
	local display = options.display or parsed.display&lt;br /&gt;
	&lt;br /&gt;
	-- Deal with the case where we don&amp;#039;t have to pipe the link&lt;br /&gt;
	if not display and not parsed.section and not options.italicizePage then&lt;br /&gt;
		return string.format(&amp;#039;[[:%s]]&amp;#039;, parsed.link)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Find the display text for piped links&lt;br /&gt;
	if not display then&lt;br /&gt;
		local page = maybeItalicize(parsed.page, options.italicizePage)&lt;br /&gt;
		local section = maybeItalicize(parsed.section, options.italicizeSection)&lt;br /&gt;
		if not page then&lt;br /&gt;
			display = string.format(&amp;#039;§&amp;amp;nbsp;%s&amp;#039;, section)&lt;br /&gt;
		elseif section then&lt;br /&gt;
			display = string.format(&amp;#039;%s §&amp;amp;nbsp;%s&amp;#039;, page, section)&lt;br /&gt;
		else&lt;br /&gt;
			display = page&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return string.format(&amp;#039;[[:%s|%s]]&amp;#039;, parsed.link, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Hatnote&lt;br /&gt;
--&lt;br /&gt;
-- Produces standard hatnote text. Implements the {{hatnote}} template.&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.hatnote(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local s = args[1]&lt;br /&gt;
	local options = {}&lt;br /&gt;
	if not s then&lt;br /&gt;
		return p.makeWikitextError(&lt;br /&gt;
			&amp;#039;no text specified&amp;#039;,&lt;br /&gt;
			&amp;#039;Template:Hatnote#Errors&amp;#039;,&lt;br /&gt;
			args.category&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	options.extraclasses = args.extraclasses&lt;br /&gt;
	options.selfref = args.selfref&lt;br /&gt;
	return p._hatnote(s, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._hatnote(s, options)&lt;br /&gt;
	checkType(&amp;#039;_hatnote&amp;#039;, 1, s, &amp;#039;string&amp;#039;)&lt;br /&gt;
	checkType(&amp;#039;_hatnote&amp;#039;, 2, options, &amp;#039;table&amp;#039;, true)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	local classes = {&amp;#039;hatnote&amp;#039;, &amp;#039;navigation-not-searchable&amp;#039;}&lt;br /&gt;
	local extraclasses = options.extraclasses&lt;br /&gt;
	local selfref = options.selfref&lt;br /&gt;
	if type(extraclasses) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		classes[#classes + 1] = extraclasses&lt;br /&gt;
	end&lt;br /&gt;
	if selfref then&lt;br /&gt;
		classes[#classes + 1] = &amp;#039;selfref&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;&amp;lt;div role=&amp;quot;note&amp;quot; class=&amp;quot;%s&amp;quot;&amp;gt;%s&amp;lt;/div&amp;gt;&amp;#039;,&lt;br /&gt;
		table.concat(classes, &amp;#039; &amp;#039;),&lt;br /&gt;
		s&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
</feed>