<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AHatnote_group%2Fdoc</id>
	<title>Module:Hatnote group/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AHatnote_group%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Hatnote_group/doc&amp;action=history"/>
	<updated>2026-05-07T21:27:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Hatnote_group/doc&amp;diff=136457&amp;oldid=prev</id>
		<title>imported&gt;Nihiltres: Expanded documentation.</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Hatnote_group/doc&amp;diff=136457&amp;oldid=prev"/>
		<updated>2021-05-05T02:59:40Z</updated>

		<summary type="html">&lt;p&gt;Expanded documentation.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
Implements {{tl|hatnote group}}, for merging multiple hatnotes into a grouped hatnote.&lt;br /&gt;
&lt;br /&gt;
==Technical details==&lt;br /&gt;
The module attempts to find each hatnote-looking &amp;lt;code&amp;gt;div&amp;lt;/code&amp;gt; element, and parse them into space-separated &amp;lt;code&amp;gt;span&amp;lt;/code&amp;gt; elements wrapped in a larger, generic hatnote.&lt;br /&gt;
&lt;br /&gt;
First, it matches every pattern that &amp;quot;looks like a hatnote&amp;quot; in its input text; this is where most problems are likely to originate as the pattern is fairly sensitive to any difference in the form of a hatnote.&lt;br /&gt;
&lt;br /&gt;
From each of the pattern matches, it constructs a table. Each element (&amp;quot;row&amp;quot;) of the table corresponds to one original hatnote, and is a table that contains a string with the rendered inner content of the hatnote, and an inner table containing any &amp;quot;extra&amp;quot; classes associated with that hatnote (e.g. &amp;lt;code&amp;gt;selfreference&amp;lt;/code&amp;gt; from a {{tl|self reference}} hatnote, or any classes from the &amp;lt;code&amp;gt;extraclasses&amp;lt;/code&amp;gt; parameter of {{tl|hatnote}}).&lt;br /&gt;
&lt;br /&gt;
It also separately looks for all categories in case they&amp;#039;re present &amp;#039;&amp;#039;outside&amp;#039;&amp;#039; the hatnote &amp;lt;code&amp;gt;div&amp;lt;/code&amp;gt; element, and adds them to a concatenated string of all &amp;quot;loose categories&amp;quot; to make sure they&amp;#039;re not accidentally removed by the hatnote grouping process.&lt;br /&gt;
&lt;br /&gt;
Once all rows are available, it looks at the tables of classes. It adds every class from every row into a table of &amp;quot;universal&amp;quot; classes, then filters out the ones that aren&amp;#039;t universal by looking at each row&amp;#039;s list and eliminating an item if it isn&amp;#039;t present in any one row. Then, &amp;quot;universal&amp;quot; classes are removed from each row&amp;#039;s classes table, so that they&amp;#039;re not duplicated later.&lt;br /&gt;
&lt;br /&gt;
This processing having been done, each row is formatted with a &amp;lt;code&amp;gt;span&amp;lt;/code&amp;gt; element that includes the extra classes associated with that row, the &amp;lt;code&amp;gt;spans&amp;lt;/code&amp;gt; for each row are joined as a space-separated list, the &amp;quot;loose categories&amp;quot; are tacked on in turn, and then the resulting string is fed into the main hatnote module, with extra classes on the main hatnote being supplied by collating the &amp;quot;universal classes&amp;quot; table into a space-separated list of its keys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Hatnote modules| ]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Nihiltres</name></author>
	</entry>
</feed>