<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki3d.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATaxonList</id>
	<title>Module:TaxonList - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki3d.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATaxonList"/>
	<link rel="alternate" type="text/html" href="https://mediawiki3d.org/index.php?title=Module:TaxonList&amp;action=history"/>
	<updated>2026-04-26T22:30:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://mediawiki3d.org/index.php?title=Module:TaxonList&amp;diff=487&amp;oldid=prev</id>
		<title>Bawolff: 1 revision imported from :wikipedia:en:Module:TaxonList</title>
		<link rel="alternate" type="text/html" href="https://mediawiki3d.org/index.php?title=Module:TaxonList&amp;diff=487&amp;oldid=prev"/>
		<updated>2025-08-16T01:55:53Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://en.wikipedia.org/wiki/en:Module:TaxonList&quot; class=&quot;extiw&quot; title=&quot;wikipedia:en:Module:TaxonList&quot;&gt;wikipedia:en:Module:TaxonList&lt;/a&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 01:55, 16 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key wiki3d:diff:1.41:old-486:rev-487 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bawolff</name></author>
	</entry>
	<entry>
		<id>https://mediawiki3d.org/index.php?title=Module:TaxonList&amp;diff=486&amp;oldid=prev</id>
		<title>wikipedia:en&gt;Pppery: Copy from sandbox per request on talk</title>
		<link rel="alternate" type="text/html" href="https://mediawiki3d.org/index.php?title=Module:TaxonList&amp;diff=486&amp;oldid=prev"/>
		<updated>2025-06-10T03:51:53Z</updated>

		<summary type="html">&lt;p&gt;Copy from sandbox per request on talk&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
This module provides the core functionality to a set of templates used to&lt;br /&gt;
display a list of taxon name/authority pairs, with the taxon names optionally&lt;br /&gt;
italicized, wikilinked and/or emboldened. Such lists are usually part of&lt;br /&gt;
taxoboxes.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
-- use a function from Module:TaxonItalics to italicize a taxon name&lt;br /&gt;
local TaxonItalics = require(&amp;quot;Module:TaxonItalics&amp;quot;)&lt;br /&gt;
local IfPreview = require([[Module:If preview]])&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--[[=========================================================================&lt;br /&gt;
Utility function to strip off any initial † present to mark the taxon as&lt;br /&gt;
extinct. The † must not be italicized, emboldened, or included in the&lt;br /&gt;
wikilinked text, so needs to be added back afterwards.&lt;br /&gt;
† is assumed to be present as one of:&lt;br /&gt;
* the unicode character †&lt;br /&gt;
* the HTML entity &amp;amp;dagger;&lt;br /&gt;
* the output of {{extinct}} – this will have been expanded before reaching this&lt;br /&gt;
  module and is assumed to have the form &amp;#039;&amp;lt;span ... &amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
The function returns two values: the taxon name with any † before it removed&lt;br /&gt;
and either &amp;#039;†&amp;#039; if it was present or the empty string if not.&lt;br /&gt;
=============================================================================]]&lt;br /&gt;
function p.stripDagger(taxonName)&lt;br /&gt;
	local dagger = &amp;#039;&amp;#039;&lt;br /&gt;
	if mw.ustring.sub(taxonName,1,1) == &amp;#039;†&amp;#039; then&lt;br /&gt;
		taxonName = mw.ustring.sub(taxonName,2,#taxonName)&lt;br /&gt;
		dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
	else &lt;br /&gt;
		if string.sub(taxonName,1,8) == &amp;#039;&amp;amp;dagger;&amp;#039; then&lt;br /&gt;
			taxonName = string.sub(taxonName,9,#taxonName)&lt;br /&gt;
			dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			-- did the taxon name originally have {{extinct}} before it?&lt;br /&gt;
			if (string.sub(taxonName,1,5) == &amp;#039;&amp;lt;abbr&amp;#039;) and mw.ustring.find(taxonName, &amp;#039;†&amp;#039;) then&lt;br /&gt;
				taxonName = string.gsub(taxonName, &amp;#039;^.*&amp;lt;/abbr&amp;gt;&amp;#039;, &amp;#039;&amp;#039;, 1)&lt;br /&gt;
				dagger = &amp;#039;†&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return taxonName, dagger&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[=========================================================================&lt;br /&gt;
Utility function to do the following:&lt;br /&gt;
&lt;br /&gt;
1. Strip off any initial † present to mark the taxon as extinct. We outsource&lt;br /&gt;
to p.stripDagger() for this.&lt;br /&gt;
&lt;br /&gt;
2. Strip off any double quotation marks present to mark the taxon as invalid.&lt;br /&gt;
The double-quotation marks, too, should not be formatted.&lt;br /&gt;
&lt;br /&gt;
3. Strip off any Candidatus or Ca. to mark the taxon as Candidatus.&lt;br /&gt;
&lt;br /&gt;
The function returns four values:&lt;br /&gt;
* the taxon name with all of the three modifiers removed&lt;br /&gt;
* either &amp;#039;†&amp;#039; if it was present or the empty string if not&lt;br /&gt;
* either a single dquote if it was present in a pair or the empty string if not&lt;br /&gt;
* either italicized &amp;quot;Candidatus &amp;quot; or &amp;quot;Ca. &amp;quot; if it was present or the empty string if not&lt;br /&gt;
&lt;br /&gt;
The function can error in case of an unpaired quotation mark. In that case, a&lt;br /&gt;
IfPreview._warning() is mixed into the first return.&lt;br /&gt;
=============================================================================]]&lt;br /&gt;
function p.parseName(taxonName)&lt;br /&gt;
	local name, dagger = p.stripDagger(taxonName)&lt;br /&gt;
	local dquote = &amp;#039;&amp;#039;&lt;br /&gt;
	if string.sub(name,1,1) == &amp;#039;&amp;quot;&amp;#039; then&lt;br /&gt;
		name = string.sub(name,2)&lt;br /&gt;
		dquote = &amp;#039;&amp;quot;&amp;#039;&lt;br /&gt;
		if string.sub(name,#name) == &amp;#039;&amp;quot;&amp;#039; then&lt;br /&gt;
			name = string.sub(name,1,#name-1)&lt;br /&gt;
		else&lt;br /&gt;
			name = &amp;#039;|&amp;#039; .. IfPreview._warning({&amp;#039;&amp;quot;&amp;#039; .. name .. &amp;#039; has an unpaired double quote.&amp;#039;})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local candidatus = &amp;#039;&amp;#039;&lt;br /&gt;
	if string.sub(name,1,11) == &amp;#039;Candidatus &amp;#039; then&lt;br /&gt;
		name = string.sub(name,12)&lt;br /&gt;
		candidatus = &amp;quot;&amp;#039;&amp;#039;Candidatus&amp;#039;&amp;#039; &amp;quot;&lt;br /&gt;
	elseif string.sub(name,1,4) == &amp;#039;Ca. &amp;#039; then&lt;br /&gt;
		name = string.sub(name,5)&lt;br /&gt;
		candidatus = &amp;quot;&amp;#039;&amp;#039;Ca.&amp;#039;&amp;#039; &amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return name, dagger, dquote, candidatus&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[=========================================================================&lt;br /&gt;
The function returns a list of taxon names and authorities, appropriately&lt;br /&gt;
formatted.&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:TaxonList|main&lt;br /&gt;
|italic = yes - to italicize the taxon name&lt;br /&gt;
|linked = yes - to wikilink the taxon name&lt;br /&gt;
|bold = yes - to emboldent the taxon name&lt;br /&gt;
|incomplete = yes - to output &amp;quot;(incomplete)&amp;quot; at the end of the list&lt;br /&gt;
}}&lt;br /&gt;
The template that transcludes the invoking template must supply an indefinite&lt;br /&gt;
even number of arguments in the format&lt;br /&gt;
|Name1|Author1 |Name2|Author2| ... |NameN|AuthorN&lt;br /&gt;
=============================================================================]]&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local italic = frame.args[&amp;#039;italic&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local bold = frame.args[&amp;#039;bold&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local linked = frame.args[&amp;#039;linked&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	if bold then linked = false end -- must not have bold and wikilinked&lt;br /&gt;
	local abbreviated = frame.args[&amp;#039;abbreviated&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local incomplete = frame.args[&amp;#039;incomplete&amp;#039;] == &amp;#039;yes&amp;#039;&lt;br /&gt;
	local taxonArgs = frame:getParent().args&lt;br /&gt;
	local result = &amp;#039;&amp;#039;&lt;br /&gt;
	-- iterate over unnamed variables&lt;br /&gt;
	local taxonName&lt;br /&gt;
	local dagger&lt;br /&gt;
	local dquote&lt;br /&gt;
	local candidatus&lt;br /&gt;
	local first = true -- is this the first of a taxon name/author pair?&lt;br /&gt;
	for param, value in pairs(taxonArgs) do&lt;br /&gt;
		if tonumber(param) then&lt;br /&gt;
			if first then&lt;br /&gt;
				taxonName = mw.text.trim(value)&lt;br /&gt;
				-- if necessary separate any initial modifier&lt;br /&gt;
				taxonName, dagger, dquote, candidatus = p.parseName(taxonName)&lt;br /&gt;
				if linked and not (italic and candidatus == &amp;#039;&amp;#039;) then&lt;br /&gt;
					taxonName = &amp;#039;[[&amp;#039; .. taxonName .. &amp;#039;]]&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				if italic and candidatus == &amp;#039;&amp;#039; then&lt;br /&gt;
					taxonName = TaxonItalics.italicizeTaxonName(taxonName, linked, abbreviated)&lt;br /&gt;
				end&lt;br /&gt;
				taxonName = candidatus .. taxonName&lt;br /&gt;
				if bold then&lt;br /&gt;
					taxonName = &amp;#039;&amp;lt;b&amp;gt;&amp;#039; .. taxonName .. &amp;#039;&amp;lt;/b&amp;gt;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				result = result .. &amp;#039;&amp;lt;li&amp;gt;&amp;#039; .. dagger .. dquote .. taxonName .. dquote&lt;br /&gt;
			else&lt;br /&gt;
				result = result .. &amp;#039; &amp;lt;small&amp;gt;&amp;#039; .. value .. &amp;#039;&amp;lt;/small&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			first = not first&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if incomplete then&lt;br /&gt;
		result = result .. &amp;#039;&amp;lt;small&amp;gt;(incomplete list)&amp;lt;/small&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;lt;ul class=&amp;quot;taxonlist&amp;quot;&amp;gt;&amp;#039; .. result .. &amp;#039;&amp;lt;/ul&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia:en&gt;Pppery</name></author>
	</entry>
</feed>