<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AFootnotes</id>
	<title>Module:Footnotes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AFootnotes"/>
	<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;action=history"/>
	<updated>2026-04-03T19:41:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9181&amp;oldid=prev</id>
		<title>Timothy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9181&amp;oldid=prev"/>
		<updated>2023-07-09T00:50:47Z</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 20:50, 8 July 2023&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>Timothy</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9226&amp;oldid=prev</id>
		<title>wikipedia&gt;Legoktm: Replace Module:No globals with require( &quot;strict&quot; )</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9226&amp;oldid=prev"/>
		<updated>2022-10-21T21:15:31Z</updated>

		<summary type="html">&lt;p&gt;Replace &lt;a href=&quot;/wiki/Module:No_globals&quot; title=&quot;Module:No globals&quot;&gt;Module:No globals&lt;/a&gt; with require( &amp;quot;strict&amp;quot; )&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 17:15, 21 October 2022&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>wikipedia&gt;Legoktm</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9180&amp;oldid=prev</id>
		<title>wikipedia&gt;Legoktm: Replace Module:No globals with require( &quot;strict&quot; )</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=9180&amp;oldid=prev"/>
		<updated>2022-10-21T21:15:31Z</updated>

		<summary type="html">&lt;p&gt;Replace &lt;a href=&quot;/wiki/Module:No_globals&quot; title=&quot;Module:No globals&quot;&gt;Module:No globals&lt;/a&gt; with require( &amp;quot;strict&amp;quot; )&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 17:15, 21 October 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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;require(&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Module:No globals&lt;/del&gt;&#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;require(&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;strict&lt;/ins&gt;&#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 getArgs = require (&amp;#039;Module:Arguments&amp;#039;).getArgs;&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 getArgs = require (&amp;#039;Module:Arguments&amp;#039;).getArgs;&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;/table&gt;</summary>
		<author><name>wikipedia&gt;Legoktm</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=2851&amp;oldid=prev</id>
		<title>Jens: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=2851&amp;oldid=prev"/>
		<updated>2022-04-03T12:16:02Z</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 08:16, 3 April 2022&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>Jens</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=2850&amp;oldid=prev</id>
		<title>wikipedia&gt;Trappist the monk at 12:03, 14 September 2021</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Footnotes&amp;diff=2850&amp;oldid=prev"/>
		<updated>2021-09-14T12:03:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;Module:No globals&amp;#039;);&lt;br /&gt;
local getArgs = require (&amp;#039;Module:Arguments&amp;#039;).getArgs;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; A R G S _ D E F A U L T &amp;gt;------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
a table to specify initial values.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local args_default = {&lt;br /&gt;
	bracket_left = &amp;#039;&amp;#039;,&lt;br /&gt;
	bracket_right = &amp;#039;&amp;#039;,&lt;br /&gt;
	bracket_year_left = &amp;#039;&amp;#039;,&lt;br /&gt;
	bracket_year_right = &amp;#039;&amp;#039;,&lt;br /&gt;
	postscript = &amp;#039;&amp;#039;,&lt;br /&gt;
	page = &amp;#039;&amp;#039;,&lt;br /&gt;
	pages = &amp;#039;&amp;#039;,&lt;br /&gt;
	location = &amp;#039;&amp;#039;,&lt;br /&gt;
	page_sep = &amp;quot;, p.&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
	pages_sep = &amp;quot;, pp.&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
	ref = &amp;#039;&amp;#039;,&lt;br /&gt;
	template = &amp;#039;harv&amp;#039;,															-- if template name not provided in {{#invoke:}} use this&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; T A R G E T _ C H E C K &amp;gt;------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
look for anchor_id (CITEREF name-list and year or text from |ref=) in anchor_id_list&lt;br /&gt;
&lt;br /&gt;
the &amp;#039;no target&amp;#039; error may be suppressed with |ignore-err=yes when target cannot be found because target is inside&lt;br /&gt;
a template that wraps another template; &amp;#039;multiple targets&amp;#039; error may not be suppressed&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function target_check (anchor_id, args)&lt;br /&gt;
	local namespace = mw.title.getCurrentTitle().namespace;&lt;br /&gt;
	local anchor_id_list_module = mw.loadData (&amp;#039;Module:Footnotes/anchor_id_list&amp;#039;);&lt;br /&gt;
	local anchor_id_list = anchor_id_list_module.anchor_id_list;&lt;br /&gt;
	local article_whitelist = anchor_id_list_module.article_whitelist;&lt;br /&gt;
	local template_list = anchor_id_list_module.template_list;&lt;br /&gt;
	&lt;br /&gt;
	local whitelist_module = mw.loadData (&amp;#039;Module:Footnotes/whitelist&amp;#039;);&lt;br /&gt;
	local whitelist = whitelist_module.whitelist;&lt;br /&gt;
	local special_patterns = whitelist_module.special_patterns;&lt;br /&gt;
	local DNB_special_patterns = whitelist_module.DNB_special_patterns;&lt;br /&gt;
	local DNB_template_names = whitelist_module.DNB_template_names;&lt;br /&gt;
&lt;br /&gt;
	if 10 == namespace then&lt;br /&gt;
		return &amp;#039;&amp;#039;;																-- automatic form of |no-tracking=yes; TODO: is this too broad?&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local tally = anchor_id_list[anchor_id];									-- nil when anchor_id not in list; else a tally&lt;br /&gt;
	local msg;&lt;br /&gt;
	local category;&lt;br /&gt;
&lt;br /&gt;
	if not tally then&lt;br /&gt;
		if args.ignore then&lt;br /&gt;
			return &amp;#039;&amp;#039;;															-- if ignore is true then no message, no category&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if article_whitelist and article_whitelist[anchor_id] then				-- if an article-local whitelist and anchor ID is in it&lt;br /&gt;
			return &amp;#039;&amp;#039;;															-- done&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local wl_anchor_id = anchor_id;											-- copy to be modified to index into the whitelist&lt;br /&gt;
		&lt;br /&gt;
		if args.year then														-- for anchor IDs created by this template (not in |ref=) that have a date&lt;br /&gt;
			if args.year:match (&amp;#039;%d%l$&amp;#039;) or										-- use the date value to determine if we should remove the disambiguator&lt;br /&gt;
				args.year:match (&amp;#039;n%.d%.%l$&amp;#039;) or&lt;br /&gt;
				args.year:match (&amp;#039;nd%l$&amp;#039;) then&lt;br /&gt;
					wl_anchor_id = wl_anchor_id:gsub (&amp;#039;%l$&amp;#039;, &amp;#039;&amp;#039;);				-- remove the disambiguator&lt;br /&gt;
			end&lt;br /&gt;
		end		&lt;br /&gt;
&lt;br /&gt;
		local t_tbl = whitelist[wl_anchor_id];									-- get list of templates associated with this anchor ID&lt;br /&gt;
&lt;br /&gt;
		if t_tbl then															-- when anchor ID not whitelisted t_tbl is nil&lt;br /&gt;
			for _, t in ipairs (t_tbl) do										-- spin through the list of templates associated with this anchor ID&lt;br /&gt;
				if template_list[t] then										-- if associated template is found in the list of templates in the article&lt;br /&gt;
					return &amp;#039;&amp;#039;;													-- anchor ID is whitlisted and article has matching template so no error&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		for _, pattern in ipairs (special_patterns) do							-- spin through the spcial patterns and try to match&lt;br /&gt;
			if anchor_id:match (pattern) then&lt;br /&gt;
				return &amp;#039;&amp;#039;;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		for _, dnb_t in ipairs (DNB_template_names or {}) do					-- getting desparate now, are there any DNB templates? DNB_template_names may be nil; empty table prevents script error&lt;br /&gt;
			if template_list[dnb_t] then										-- if the article has this DNB template&lt;br /&gt;
				for _, pattern in ipairs (DNB_special_patterns) do				-- spin through the DNB-specifiec wildcard patterns&lt;br /&gt;
					if anchor_id:match (pattern) then							-- and attempt a match&lt;br /&gt;
						return &amp;#039;&amp;#039;;												-- found a match&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		msg = &amp;#039;no target: &amp;#039; .. anchor_id;										-- anchor_id not found&lt;br /&gt;
		category = &amp;#039;[[Category:Harv and Sfn no-target errors]]&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
	elseif 1 &amp;lt; tally then&lt;br /&gt;
		msg = &amp;#039;multiple targets (&amp;#039; .. tally .. &amp;#039;×): &amp;#039; .. anchor_id;				-- more than one anchor_id in this article&lt;br /&gt;
		category = 0 == namespace and &amp;#039;[[Category:Harv and Sfn multiple-target errors]]&amp;#039; or &amp;#039;&amp;#039;;								-- only categorize in article space&lt;br /&gt;
		return &amp;#039;&amp;lt;span class=&amp;quot;error harv-error&amp;quot; style=&amp;quot;display: inline; font-size:100%&amp;quot;&amp;gt; &amp;#039; .. args.template .. &amp;#039; error: &amp;#039; .. msg .. &amp;#039; ([[:Category:Harv and Sfn template errors|help]])&amp;lt;/span&amp;gt;&amp;#039; .. category;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
--	category = 0 == namespace and &amp;#039;[[Category:Harv and Sfn template errors]]&amp;#039; or &amp;#039;&amp;#039;;	-- only categorize in article space&lt;br /&gt;
	category = 0 == namespace and category or &amp;#039;&amp;#039;;								-- only categorize in article space&lt;br /&gt;
&lt;br /&gt;
--use this version to show error messages&lt;br /&gt;
--	return msg and &amp;#039;&amp;lt;span class=&amp;quot;error harv-error&amp;quot; style=&amp;quot;display: inline; font-size:100%&amp;quot;&amp;gt; &amp;#039; .. args.template .. &amp;#039; error: &amp;#039; .. msg .. &amp;#039; ([[:Category:Harv and Sfn template errors|help]])&amp;lt;/span&amp;gt;&amp;#039; .. category or &amp;#039;&amp;#039;;&lt;br /&gt;
--use this version to hide error messages&lt;br /&gt;
	return msg and &amp;#039;&amp;lt;span class=&amp;quot;error harv-error&amp;quot; style=&amp;quot;display: none; font-size:100%&amp;quot;&amp;gt; &amp;#039; .. args.template .. &amp;#039; error: &amp;#039; .. msg .. &amp;#039; ([[:Category:Harv and Sfn template errors|help]])&amp;lt;/span&amp;gt;&amp;#039; .. category or &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ Y E A R &amp;gt;----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
evaluates param to see if it is one of these forms with or without lowercase letter disambiguator:&lt;br /&gt;
	YYYY&lt;br /&gt;
	n.d.&lt;br /&gt;
	nd	&lt;br /&gt;
	c. YYYY&lt;br /&gt;
	YYYY–YYYY	(separator is endash)&lt;br /&gt;
	YYYY–YY		(separator is endash)&lt;br /&gt;
&lt;br /&gt;
return true when param has a recognized form; false else&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local patterns_date= {&lt;br /&gt;
	&amp;#039;^%d%d%d%d?%l?$&amp;#039;,&lt;br /&gt;
	&amp;#039;^n%.d%.%l?$&amp;#039;,&lt;br /&gt;
	&amp;#039;^nd%l?$&amp;#039;,&lt;br /&gt;
	&amp;#039;^c%. %d%d%d%d?%l?$&amp;#039;,&lt;br /&gt;
	&amp;#039;^%d%d%d%d–%d%d%d%d%l?$&amp;#039;,&lt;br /&gt;
	&amp;#039;^%d%d%d%d–%d%d%l?$&amp;#039;,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local function is_year (param, args)&lt;br /&gt;
	args.year = &amp;#039;&amp;#039;;																-- used for harv error; &lt;br /&gt;
	&lt;br /&gt;
	for _, pattern in ipairs (patterns_date) do&lt;br /&gt;
		if mw.ustring.match (param, pattern) then&lt;br /&gt;
			args.year = param;													-- used for harv error; &lt;br /&gt;
			return true;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O R E &amp;gt;----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns an anchor link (CITEREF) formed from one to four author names, year, and insource location (|p=, |pp=, loc=)&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function core( args )&lt;br /&gt;
	local result;&lt;br /&gt;
	local err_msg = &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	if args.P5 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if is_year (args.P5, args) then&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; et al. &amp;#039;, args.bracket_year_left, args.P5, args.bracket_year_right});&lt;br /&gt;
		else&lt;br /&gt;
			args.P5 = &amp;#039;&amp;#039;;														-- when P5 not a year don&amp;#039;t include in anchor&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; et al.&amp;#039;});						-- and don&amp;#039;t render it&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif args.P4 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if is_year (args.P4, args) then&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039;, &amp;#039;, args.P2, &amp;#039; &amp;amp;amp; &amp;#039;, args.P3, &amp;#039; &amp;#039;, args.bracket_year_left, args.P4, args.bracket_year_right});	-- three names and a year&lt;br /&gt;
		else&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; et al.&amp;#039;});						-- four names&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif args.P3 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if is_year (args.P3, args) then&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; &amp;amp;amp; &amp;#039;, args.P2, &amp;#039; &amp;#039;, args.bracket_year_left, args.P3, args.bracket_year_right});	-- two names and a year&lt;br /&gt;
		else&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039;, &amp;#039;, args.P2, &amp;#039; &amp;#039;, &amp;#039; &amp;amp;amp; &amp;#039;, args.P3});	-- three names&lt;br /&gt;
		end&lt;br /&gt;
			&lt;br /&gt;
	elseif args.P2 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if is_year (args.P2, args) then&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; &amp;#039;, args.bracket_year_left, args.P2, args.bracket_year_right});	-- one name and year&lt;br /&gt;
		else&lt;br /&gt;
			result = table.concat ({args.P1, &amp;#039; &amp;amp;amp; &amp;#039;, args.P2});				-- two names&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	else&lt;br /&gt;
		result = args.P1;														-- one name&lt;br /&gt;
	end&lt;br /&gt;
																				-- when author-date result ends with a dot (typically when the last positional parameter holds &amp;#039;n.d.&amp;#039;)&lt;br /&gt;
																				-- and when no in-source location (no |p=, |pp=, or |loc=)&lt;br /&gt;
																				-- and when the first or only character in args.postscript is a dot&lt;br /&gt;
																				-- remove the author-date result trailing dot&lt;br /&gt;
																				-- the author-date result trailing dot will be replaced later with the content of args.postscript (usually a dot)&lt;br /&gt;
	if (&amp;#039;.&amp;#039; == result:sub(-1)) and (&amp;#039;.&amp;#039; == args.postscript:sub(1)) and (&amp;#039;&amp;#039; == args.page) and (&amp;#039;&amp;#039; == args.pages) and (&amp;#039;&amp;#039; == args.location) then&lt;br /&gt;
		result = result:gsub (&amp;#039;%.$&amp;#039;, &amp;#039;&amp;#039;);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args.ref ~= &amp;#039;none&amp;#039; then&lt;br /&gt;
		local anchor_id;&lt;br /&gt;
		if args.ref ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			anchor_id = mw.uri.anchorEncode (args.ref);&lt;br /&gt;
			err_msg = target_check (anchor_id, args);&lt;br /&gt;
			result = table.concat ({&amp;#039;[[#&amp;#039;, anchor_id, &amp;#039;|&amp;#039;, result, &amp;#039;]]&amp;#039;});&lt;br /&gt;
		else&lt;br /&gt;
			anchor_id = mw.uri.anchorEncode (table.concat ({&amp;#039;CITEREF&amp;#039;, args.P1, args.P2, args.P3, args.P4, args.P5}));&lt;br /&gt;
			err_msg = target_check (anchor_id, args);&lt;br /&gt;
			result = table.concat ({&amp;#039;[[#&amp;#039;, anchor_id, &amp;#039;|&amp;#039;, result, &amp;#039;]]&amp;#039;});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.page ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		result = table.concat ({result, args.page_sep, args.page});&lt;br /&gt;
	elseif args.pages ~= &amp;#039;&amp;#039;then&lt;br /&gt;
		result = table.concat ({result, args.pages_sep, args.pages});&lt;br /&gt;
	end      &lt;br /&gt;
&lt;br /&gt;
	if args.location ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		result = table.concat ({result, &amp;#039;, &amp;#039;, args.location});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	result = table.concat ({args.bracket_left, result, args.bracket_right, args.postscript}):gsub (&amp;#039;%s+&amp;#039;, &amp;#039; &amp;#039;);		-- strip redundant spaces&lt;br /&gt;
	return result .. err_msg;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H Y P H E N _ T O _ D A S H &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Converts a hyphen to a dash under certain conditions.  The hyphen must separate&lt;br /&gt;
like items; unlike items are returned unmodified.  These forms are modified:&lt;br /&gt;
	letter - letter (A - B)&lt;br /&gt;
	digit - digit (4-5)&lt;br /&gt;
	digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)&lt;br /&gt;
	letterdigit - letterdigit (A1-A5) (an optional separator between letter and&lt;br /&gt;
		digit is supported – a.1-a.5 or a-1-a-5)&lt;br /&gt;
	digitletter - digitletter (5a - 5d) (an optional separator between letter and&lt;br /&gt;
		digit is supported – 5.a-5.d or 5-a-5-d)&lt;br /&gt;
&lt;br /&gt;
any other forms are returned unmodified.&lt;br /&gt;
&lt;br /&gt;
str may be a comma- or semicolon-separated list&lt;br /&gt;
&lt;br /&gt;
This code copied from Module:Citation/CS1.  The only modification is to require Module:Citation/CS1/Utilities&lt;br /&gt;
so that it has access to the functions is_set() and has_accept_as_written()&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function hyphen_to_dash( str )&lt;br /&gt;
	local utilities = require (&amp;#039;Module:Citation/CS1/Utilities&amp;#039;);				-- only modification so that this function has access to is_set() and has_accept_as_written()&lt;br /&gt;
&lt;br /&gt;
	if not utilities.is_set (str) then&lt;br /&gt;
		return str;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local accept; -- Boolean&lt;br /&gt;
&lt;br /&gt;
	str = str:gsub (&amp;#039;&amp;amp;[nm]dash;&amp;#039;, {[&amp;#039;&amp;amp;ndash;&amp;#039;] = &amp;#039;–&amp;#039;, [&amp;#039;&amp;amp;mdash;&amp;#039;] = &amp;#039;—&amp;#039;});		-- replace &amp;amp;mdash; and &amp;amp;ndash; entities with their characters; semicolon mucks up the text.split&lt;br /&gt;
	str = str:gsub (&amp;#039;&amp;amp;#45;&amp;#039;, &amp;#039;-&amp;#039;); -- replace HTML numeric entity with hyphen character&lt;br /&gt;
&lt;br /&gt;
	str = str:gsub (&amp;#039;&amp;amp;nbsp;&amp;#039;, &amp;#039; &amp;#039;); -- replace &amp;amp;nbsp; entity with generic keyboard space character&lt;br /&gt;
	&lt;br /&gt;
	local out = {};&lt;br /&gt;
	local list = mw.text.split (str, &amp;#039;%s*[,;]%s*&amp;#039;);								-- split str at comma or semicolon separators if there are any&lt;br /&gt;
&lt;br /&gt;
	for _, item in ipairs (list) do												-- for each item in the list&lt;br /&gt;
		item, accept = utilities.has_accept_as_written (item);					-- remove accept-this-as-written markup when it wraps all of item&lt;br /&gt;
		if not accept and mw.ustring.match (item, &amp;#039;^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$&amp;#039;) then	-- if a hyphenated range or has endash or emdash separators&lt;br /&gt;
			if item:match (&amp;#039;^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$&amp;#039;) or			-- letterdigit hyphen letterdigit (optional separator between letter and digit)&lt;br /&gt;
				item:match (&amp;#039;^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$&amp;#039;) or			-- digitletter hyphen digitletter (optional separator between digit and letter)&lt;br /&gt;
				item:match (&amp;#039;^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$&amp;#039;) or			-- digit separator digit hyphen digit separator digit&lt;br /&gt;
				item:match (&amp;#039;^%d+%s*%-%s*%d+$&amp;#039;) or								-- digit hyphen digit&lt;br /&gt;
				item:match (&amp;#039;^%a+%s*%-%s*%a+$&amp;#039;) then							-- letter hyphen letter&lt;br /&gt;
					item = item:gsub (&amp;#039;(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)&amp;#039;, &amp;#039;%1–%2&amp;#039;);	-- replace hyphen, remove extraneous space characters&lt;br /&gt;
			else&lt;br /&gt;
				item = mw.ustring.gsub (item, &amp;#039;%s*[–—]%s*&amp;#039;, &amp;#039;–&amp;#039;);				-- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		table.insert (out, item);												-- add the (possibly modified) item to the output table&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local temp_str = &amp;#039;&amp;#039;;														-- concatenate the output table into a comma separated string&lt;br /&gt;
	temp_str, accept = utilities.has_accept_as_written (table.concat (out, &amp;#039;, &amp;#039;)); -- remove accept-this-as-written markup when it wraps all of concatenated out&lt;br /&gt;
	if accept then&lt;br /&gt;
		temp_str = utilities.has_accept_as_written (str);						-- when global markup removed, return original str; do it this way to suppress boolean second return value&lt;br /&gt;
		return temp_str;&lt;br /&gt;
	else&lt;br /&gt;
		return temp_str;														-- else, return assembled temp_str&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; A R G S  _ F E T C H &amp;gt;---------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Because all of the templates share a common set of parameters, a single common function to fetch those parameters&lt;br /&gt;
from frame and parent frame.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function args_fetch (frame, ps)&lt;br /&gt;
	local args = args_default;													-- create a copy of the default table&lt;br /&gt;
	local pframe = frame:getParent();											-- point to the template&amp;#039;s parameter table&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs (frame.args) do											-- override defaults with values provided in the #invoke: if any&lt;br /&gt;
		args[k] = v;	   &lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	args.postscript = pframe.args.postscript or pframe.args.ps or ps;&lt;br /&gt;
	if &amp;#039;none&amp;#039; == args.postscript then&lt;br /&gt;
		args.postscript = &amp;#039;&amp;#039;;&lt;br /&gt;
	end&lt;br /&gt;
	args.page = pframe.args.p or pframe.args.page or &amp;#039;&amp;#039;;&lt;br /&gt;
	args.pages = pframe.args.pp or pframe.args.pages or &amp;#039;&amp;#039;;&lt;br /&gt;
	args.pages = (&amp;#039;&amp;#039; ~= args.pages) and hyphen_to_dash (args.pages) or &amp;#039;&amp;#039;;&lt;br /&gt;
	args.location = pframe.args.loc or &amp;#039;&amp;#039;;&lt;br /&gt;
	args.ref = pframe.args.ref or pframe.args.Ref or &amp;#039;&amp;#039;;&lt;br /&gt;
	args.ignore = (&amp;#039;yes&amp;#039; == pframe.args[&amp;#039;ignore-false-positive&amp;#039;]) or (&amp;#039;yes&amp;#039; == pframe.args[&amp;#039;ignore-err&amp;#039;]);&lt;br /&gt;
&lt;br /&gt;
	for i, v in ipairs ({&amp;#039;P1&amp;#039;, &amp;#039;P2&amp;#039;, &amp;#039;P3&amp;#039;, &amp;#039;P4&amp;#039;, &amp;#039;P5&amp;#039;}) do						-- loop through the five positional parameters and trim if set else empty string&lt;br /&gt;
		args[v] = (pframe.args[i] and mw.text.trim (pframe.args[i])) or &amp;#039;&amp;#039;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.P5 and not is_year (args.P5, args) then&lt;br /&gt;
		local i = 6;															-- initialize the indexer to the sixth positional parameter&lt;br /&gt;
		while pframe.args[i] do													-- in case there are too many authors loop through the authors looking for a year&lt;br /&gt;
			local v = mw.text.trim (pframe.args[i]);							-- trim&lt;br /&gt;
			if is_year (v, args) then											-- if a year&lt;br /&gt;
				args.P5 = v;													-- overwrite whatever was in args.P5 with year&lt;br /&gt;
				break;															-- and abandon the search&lt;br /&gt;
			end&lt;br /&gt;
			i = i + 1;															-- bump the indexer&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return args;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H A R V A R D _ C I T A T I O N &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
common entry point for:&lt;br /&gt;
	{{harvard citation}} aka {{harv}}&lt;br /&gt;
	{{Harvard citation no brackets}} aka {{harvnb}}&lt;br /&gt;
	{{harvcol}}&lt;br /&gt;
	{{harvcolnb}}&lt;br /&gt;
	{{harvcoltxt}}&lt;br /&gt;
	{{Harvard citation text}} aka {{harvtxt}}&lt;br /&gt;
	{{Harvp}}&lt;br /&gt;
&lt;br /&gt;
Distinguishing features (brackets and page separators) are specified in this module&amp;#039;s {{#invoke}} in the respective templates.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function harvard_citation (frame)&lt;br /&gt;
	local args = args_fetch (frame, &amp;#039;&amp;#039;);										-- get the template and invoke parameters; default postscript is empty string&lt;br /&gt;
&lt;br /&gt;
	return core (args);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S T R I P _ U R L &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
used by sfn() and sfnm().  This function fixes an issue with reference tooltip gadget where the tooltip is not displayed&lt;br /&gt;
when an insource locator (|p=, |pp=, |loc=) has an external wikilink that contains a # character&lt;br /&gt;
&lt;br /&gt;
strip uri-reserved characters from urls in |p=, |pp-, and |loc= parameters  The researved characters are:&lt;br /&gt;
	!#$&amp;amp;&amp;#039;()*+,/:;=?@[]&lt;br /&gt;
	&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function strip_url (pages)&lt;br /&gt;
	local escaped_uri;&lt;br /&gt;
	if not pages or (&amp;#039;&amp;#039; == pages) then&lt;br /&gt;
		return pages;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for uri in pages:gmatch (&amp;#039;%[(%a[%w%+%.%-]*://%S+)&amp;#039;) do						-- for each external link get the uri&lt;br /&gt;
		escaped_uri = uri:gsub (&amp;quot;([%(%)%.%%%+%-%*%?%[%^%$%]])&amp;quot;, &amp;quot;%%%1&amp;quot; );		-- save a copy with lua pattern characters escaped&lt;br /&gt;
		uri = uri:gsub (&amp;quot;[!#%$&amp;amp;&amp;#039;%(%)%*%+,/:;=%?@%[%]%.%%]&amp;quot;, &amp;#039;&amp;#039;);				-- remove reserved characters and &amp;#039;%&amp;#039; because &amp;#039;%20&amp;#039; (space character) is a lua &amp;#039;invalid capture index&amp;#039;&lt;br /&gt;
		pages = pages:gsub (escaped_uri, uri, 1);								-- replace original uri with the stripped version&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return pages;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S F N &amp;gt;------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
entry point for {{sfn}} and {{sfnp}}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function sfn (frame)&lt;br /&gt;
	local args = args_fetch (frame, &amp;#039;.&amp;#039;);										-- get the template and invoke parameters; default postscript is a dot&lt;br /&gt;
&lt;br /&gt;
	local result = core (args);													-- go make a CITEREF anchor&lt;br /&gt;
																				-- put it all together and then strip redundant spaces&lt;br /&gt;
	local name = table.concat ({&amp;#039;FOOTNOTE&amp;#039;, args.P1, args.P2, args.P3, args.P4, args.P5, strip_url (args.page), strip_url (args.pages), strip_url (args.location)}):gsub (&amp;#039;%s+&amp;#039;, &amp;#039; &amp;#039;);&lt;br /&gt;
&lt;br /&gt;
	return frame:extensionTag ({name=&amp;#039;ref&amp;#039;, args={name=name}, content=result});	&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S F N M &amp;gt;----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
common entry point for {{sfnm}} and {{sfnmp}}&lt;br /&gt;
&lt;br /&gt;
Distinguishing features (brackets) are specified in this module&amp;#039;s {{#invoke}} in the respective templates.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function sfnm (frame)&lt;br /&gt;
	local args = args_default;													-- create a copy of the default table&lt;br /&gt;
	local pframe = frame:getParent();											-- point to the template&amp;#039;s parameter table&lt;br /&gt;
	&lt;br /&gt;
	local n = 1;																-- index of source; this is the &amp;#039;n&amp;#039; in na1, ny, etc&lt;br /&gt;
	local first_pnum = 1;														-- first of a pair of positional parameters&lt;br /&gt;
	local second_pnum = 2;														-- second of a pair of positional parameters&lt;br /&gt;
&lt;br /&gt;
	local last_ps = 0;															-- index of the last source with |nps= set&lt;br /&gt;
	local last_index = 0;														-- index of the last source; these used to determine which of |ps= or |nps= will terminate the whole rendering&lt;br /&gt;
&lt;br /&gt;
	local out = {};																-- table to hold rendered sources&lt;br /&gt;
	local footnote = {&amp;#039;FOOTNOTE&amp;#039;};												-- all author, date, insource location stuff becomes part of the reference&amp;#039;s footnote id; added as we go&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs (frame.args) do											-- override defaults with values provided in the #invoke: if any&lt;br /&gt;
		args[k] = v;	   &lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	while true do&lt;br /&gt;
		if not pframe.args[table.concat ({n, &amp;#039;a1&amp;#039;})] and not pframe.args[first_pnum] then&lt;br /&gt;
			break;																-- no na1 or matching positional parameter so done&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if pframe.args[table.concat ({n, &amp;#039;a1&amp;#039;})] then							-- does this source use named parameters?&lt;br /&gt;
			for _, v in ipairs ({&amp;#039;P1&amp;#039;, &amp;#039;P2&amp;#039;, &amp;#039;P3&amp;#039;, &amp;#039;P4&amp;#039;, &amp;#039;P5&amp;#039;}) do				-- initialize for this source&lt;br /&gt;
				args[v] = &amp;#039;&amp;#039;;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			for i, v in ipairs ({&amp;#039;P1&amp;#039;, &amp;#039;P2&amp;#039;, &amp;#039;P3&amp;#039;, &amp;#039;P4&amp;#039;, &amp;#039;P5&amp;#039;}) do				-- extract author and year parameters for this source&lt;br /&gt;
				args[v] = pframe.args[table.concat ({n, &amp;#039;a&amp;#039;, i})] or &amp;#039;&amp;#039;;		-- attempt to assign author name&lt;br /&gt;
				if &amp;#039;&amp;#039; == args[v] then											-- when there wasn&amp;#039;t an author name&lt;br /&gt;
					args[v] = pframe.args[table.concat ({n, &amp;#039;y&amp;#039;})] or &amp;#039;&amp;#039;;		-- attempt to assign year&lt;br /&gt;
					break;														-- done with author/date for this source&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
		else																	-- this source uses positional parameters&lt;br /&gt;
			args.P1 = mw.text.trim (pframe.args[first_pnum]);					-- yes, only one author supported&lt;br /&gt;
			args.P2 = (pframe.args[second_pnum] and mw.text.trim (pframe.args[second_pnum])) or &amp;#039;&amp;#039;;	-- when positional author, year must also be positional&lt;br /&gt;
&lt;br /&gt;
			for _, v in ipairs ({&amp;#039;P3&amp;#039;, &amp;#039;P4&amp;#039;, &amp;#039;P5&amp;#039;}) do							-- blank the rest of these for this source&lt;br /&gt;
				args[v] = &amp;#039;&amp;#039;;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			first_pnum = first_pnum + 2;										-- source must use positional author and positional year&lt;br /&gt;
			second_pnum = first_pnum + 1;										-- bump these for possible next positional source&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		args.postscript = pframe.args[table.concat ({n, &amp;#039;ps&amp;#039;})] or &amp;#039;&amp;#039;;&lt;br /&gt;
		if &amp;#039;none&amp;#039; == args.postscript then										-- this for compatibility with other footnote templates; does nothing&lt;br /&gt;
			args.postscript = &amp;#039;&amp;#039;;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		args.ref = pframe.args[table.concat ({n, &amp;#039;ref&amp;#039;})] or &amp;#039;&amp;#039;;				-- alternate reference for this source&lt;br /&gt;
&lt;br /&gt;
		args.page = pframe.args[table.concat ({n, &amp;#039;p&amp;#039;})] or &amp;#039;&amp;#039;;					-- insource locations for this source&lt;br /&gt;
		args.pages = pframe.args[table.concat ({n, &amp;#039;pp&amp;#039;})] or &amp;#039;&amp;#039;;&lt;br /&gt;
		args.pages = (&amp;#039;&amp;#039; ~= args.pages) and hyphen_to_dash (args.pages) or &amp;#039;&amp;#039;;&lt;br /&gt;
		args.location = pframe.args[table.concat ({n, &amp;#039;loc&amp;#039;})] or &amp;#039;&amp;#039;;&lt;br /&gt;
		args.ignore = (&amp;#039;yes&amp;#039; == pframe.args[table.concat ({n, &amp;#039;ignore-false-positive&amp;#039;})]) or (&amp;#039;yes&amp;#039; == pframe.args[table.concat ({n, &amp;#039;ignore-err&amp;#039;})]);&lt;br /&gt;
&lt;br /&gt;
		table.insert (out, core (args));										-- save the rendering of this source&lt;br /&gt;
		&lt;br /&gt;
		for k, v in ipairs ({&amp;#039;P1&amp;#039;, &amp;#039;P2&amp;#039;, &amp;#039;P3&amp;#039;, &amp;#039;P4&amp;#039;, &amp;#039;P5&amp;#039;}) do					-- create the FOOTNOTE id&lt;br /&gt;
			if &amp;#039;&amp;#039; ~= args[v] then&lt;br /&gt;
				table.insert (footnote, args[v]);&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		for k, v in ipairs ({&amp;#039;page&amp;#039;, &amp;#039;pages&amp;#039;, &amp;#039;location&amp;#039;}) do					-- these done separately so that we can strip uri-reserved characters from extlinked page numbers &lt;br /&gt;
			if &amp;#039;&amp;#039; ~= args[v] then&lt;br /&gt;
				table.insert (footnote, strip_url (args[v]))&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		last_index = n;															-- flags used to select terminal postscript from nps or from end_ps&lt;br /&gt;
		if &amp;#039;&amp;#039; ~= args.postscript then							&lt;br /&gt;
			last_ps = n;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		n = n+1;																-- bump for the next one&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local name = table.concat (footnote):gsub (&amp;#039;%s+&amp;#039;, &amp;#039; &amp;#039;);						-- put the footnote together and strip redundant space&lt;br /&gt;
	&lt;br /&gt;
	args.end_ps = pframe.args.postscript or pframe.args.ps or &amp;#039;.&amp;#039;;				-- this is the postscript for the whole not for the individual sources&lt;br /&gt;
	if &amp;#039;none&amp;#039; == args.end_ps then												-- not an original sfnm parameter value; added for compatibility with other footnote templates&lt;br /&gt;
		args.end_ps = &amp;#039;&amp;#039;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local result = table.concat ({table.concat (out, &amp;#039;; &amp;#039;), (last_index == last_ps) and &amp;#039;&amp;#039; or  args.end_ps});&lt;br /&gt;
	return frame:extensionTag ({name=&amp;#039;ref&amp;#039;, args={name=name}, content=result});&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S F N R E F &amp;gt;------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
implements {{sfnref}}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function sfnref (frame)&lt;br /&gt;
	local args = getArgs (frame);&lt;br /&gt;
	local out = {};&lt;br /&gt;
	&lt;br /&gt;
	for i=1, 5 do																-- get the first five args if there are five args&lt;br /&gt;
		if args[i] then&lt;br /&gt;
			out[i] = args[i];&lt;br /&gt;
		else&lt;br /&gt;
			break;																-- less than 5 args break out&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if 5 == #out then															-- when we have seen five args there may bemore&lt;br /&gt;
		local i = 6;															-- initialize the indexer to the sixth positional parameter&lt;br /&gt;
		while args[i] do														-- in case there are too many authors loop through the authors looking for a year&lt;br /&gt;
			if is_year (args[i], args) then										-- if a year&lt;br /&gt;
				out[5] = args[i];												-- overwrite whatever was in args[5] with year&lt;br /&gt;
				break;															-- and abandon the search&lt;br /&gt;
			end&lt;br /&gt;
			i = i + 1;															-- bump the indexer&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return mw.uri.anchorEncode (&amp;#039;CITEREF&amp;#039; .. table.concat (out));&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	harvard_citation = harvard_citation,&lt;br /&gt;
	sfn = sfn,&lt;br /&gt;
	sfnm = sfnm,&lt;br /&gt;
	sfnref = sfnref,&lt;br /&gt;
	};&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Trappist the monk</name></author>
	</entry>
</feed>