<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cultopedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AMake_Wikisource_link</id>
	<title>Module:Make Wikisource link - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.cultopedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AMake_Wikisource_link"/>
	<link rel="alternate" type="text/html" href="https://www.cultopedia.org/index.php?title=Module:Make_Wikisource_link&amp;action=history"/>
	<updated>2026-04-05T20:38:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://www.cultopedia.org/index.php?title=Module:Make_Wikisource_link&amp;diff=493&amp;oldid=prev</id>
		<title>Cultopedia-admin: Cultopedia: avoid Wikibase crash in Make Wikisource link</title>
		<link rel="alternate" type="text/html" href="https://www.cultopedia.org/index.php?title=Module:Make_Wikisource_link&amp;diff=493&amp;oldid=prev"/>
		<updated>2026-04-04T12:28:24Z</updated>

		<summary type="html">&lt;p&gt;Cultopedia: avoid Wikibase crash in Make Wikisource link&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:28, 4 April 2026&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-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&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;div&gt;local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&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 yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;local hasWikibase = mw.wikibase ~= nil&lt;/ins&gt;&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;&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;function p.makeLink(frame)&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;function p.makeLink(frame)&lt;/div&gt;&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-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&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;	&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;	&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;	-- get the Wikidata sitelink&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;	-- get the Wikidata sitelink&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 wikidataSitelink = mw.wikibase.getSitelink(&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 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikidataSitelink&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;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		&lt;/del&gt;mw.wikibase.getEntityIdForCurrentPage() or &#039;&#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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if hasWikibase then&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;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikisourceEdition&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;		&lt;/ins&gt;wikidataSitelink = mw.wikibase.getSitelink(&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;&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;			&lt;/ins&gt;mw.wikibase.getEntityIdForCurrentPage() or &#039;&#039;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;			wikisourceEdition&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;end&lt;/ins&gt;&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;		&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;		&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;	-- if we have a language parameter, we look at the second unnamed parameter for the source title&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;	-- if we have a language parameter, we look at the second unnamed parameter for the source title&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cultopedia-admin</name></author>
	</entry>
	<entry>
		<id>https://www.cultopedia.org/index.php?title=Module:Make_Wikisource_link&amp;diff=414&amp;oldid=prev</id>
		<title>imported&gt;HouseBlaster: handle searching in authorspace correctly (by not searching in authorspace at all)</title>
		<link rel="alternate" type="text/html" href="https://www.cultopedia.org/index.php?title=Module:Make_Wikisource_link&amp;diff=414&amp;oldid=prev"/>
		<updated>2025-11-16T23:34:16Z</updated>

		<summary type="html">&lt;p&gt;handle searching in authorspace correctly (by not searching in authorspace at all)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p.makeLink(frame)&lt;br /&gt;
	--[[---------&lt;br /&gt;
	Variable declaration&lt;br /&gt;
	--]]---------&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local lang = args[&amp;#039;explicit_lang_param&amp;#039;] or args[&amp;#039;implicit_lang_param&amp;#039;] or &amp;#039;en&amp;#039;&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local pagename = page.text&lt;br /&gt;
	local wikisourceEdition&lt;br /&gt;
	local linkTarget&lt;br /&gt;
	local displayText&lt;br /&gt;
	local toReturn&lt;br /&gt;
	local prefix&lt;br /&gt;
	&lt;br /&gt;
	--[[&lt;br /&gt;
	Create the prefix for the interwiki link&lt;br /&gt;
	It uses the lowest of:&lt;br /&gt;
	 1. &amp;#039;Special:Search/&amp;#039;, if using the enwiki pagename as the interwiki target&lt;br /&gt;
	 2. If not (1), an &amp;#039;Author:&amp;#039; prefix, localized, if given a works parameter and not under (1)&lt;br /&gt;
	 3. If not (1) or (2), the empty string&lt;br /&gt;
	We avoid &amp;#039;Special:Search/Author:&amp;#039; intentionally; this is rarely helpful&lt;br /&gt;
	Here we simply set it to (2) or (3), and override it when setting the link target if needed&lt;br /&gt;
	--]]&lt;br /&gt;
	prefix = args.works and frame:expandTemplate{ title = &amp;#039;Wikisource/Author&amp;#039;, args = { lang } } or &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	-- Handle multilingual Wikisource (aka old Wikisource) correctly&lt;br /&gt;
	if lang == &amp;#039;mul&amp;#039; then&lt;br /&gt;
		wikisourceEdition = &amp;#039;sourceswiki&amp;#039; -- siteid for multilingual Wikisource&lt;br /&gt;
	else&lt;br /&gt;
		wikisourceEdition = lang .. &amp;#039;wikisource&amp;#039; -- other Wikisource editions are langcode + &amp;#039;wikisource&amp;#039; (e.g. &amp;#039;enwikisource&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- get the Wikidata sitelink&lt;br /&gt;
	local wikidataSitelink = mw.wikibase.getSitelink(&lt;br /&gt;
		mw.wikibase.getEntityIdForCurrentPage() or &amp;#039;&amp;#039;,&lt;br /&gt;
		wikisourceEdition&lt;br /&gt;
	)&lt;br /&gt;
		&lt;br /&gt;
	-- if we have a language parameter, we look at the second unnamed parameter for the source title&lt;br /&gt;
	local checkIndexForTarget = args[&amp;#039;implicit_lang_param&amp;#039;] and 2 or 1&lt;br /&gt;
	-- and then use the next index for display&lt;br /&gt;
	local checkIndexForDisplay = checkIndexForTarget + 1&lt;br /&gt;
	&lt;br /&gt;
	--[[---------&lt;br /&gt;
	Set the link target&lt;br /&gt;
	--]]---------&lt;br /&gt;
	if args[&amp;#039;wslink&amp;#039;] then&lt;br /&gt;
		linkTarget = args[&amp;#039;wslink&amp;#039;]&lt;br /&gt;
	elseif args[checkIndexForTarget] then&lt;br /&gt;
		-- we have a source title parameter, so return that&lt;br /&gt;
		linkTarget = args[checkIndexForTarget]&lt;br /&gt;
	elseif wikidataSitelink then&lt;br /&gt;
		-- use Wikidata&lt;br /&gt;
		linkTarget = wikidataSitelink&lt;br /&gt;
	else&lt;br /&gt;
		-- we have no parameters and nothing at Wikidata, so we are flying blind&lt;br /&gt;
		-- set the linkTarget to the pagename&lt;br /&gt;
		linkTarget = pagename&lt;br /&gt;
		-- and set prefix to &amp;#039;Special:Search/&amp;#039; to find the appropriate link&lt;br /&gt;
		prefix = &amp;#039;Special:Search/&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- clear prefixes for now; will add it back later if needed&lt;br /&gt;
	-- this prevents duplicate prefixes (Author:Author:Shakespeare; Special:Search/Special:Search/)&lt;br /&gt;
	-- and avoids displayText with any author prefix&lt;br /&gt;
	linkTarget = string.gsub(linkTarget, &amp;#039;^&amp;#039; .. prefix, &amp;#039;&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	--[[---------	&lt;br /&gt;
	Now build the displayText&lt;br /&gt;
	--]]---------&lt;br /&gt;
	&lt;br /&gt;
	if not displayText then&lt;br /&gt;
		-- we did not set displayText in the above steps, so set it now&lt;br /&gt;
		-- first we check for an explicit display text, or else we set it to be the link target&lt;br /&gt;
		displayText = args[&amp;#039;title&amp;#039;] or args[checkIndexForDisplay] or linkTarget&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--[[---------	&lt;br /&gt;
	Now we check whether we should categorize in Category:Wikisource templates with missing id&lt;br /&gt;
	--]]---------&lt;br /&gt;
	&lt;br /&gt;
	-- initialize errorCategory as true&lt;br /&gt;
	local errorCategory = true&lt;br /&gt;
	&lt;br /&gt;
	-- helper to set errorCategory = false&lt;br /&gt;
	local function setFalse() errorCategory = false end&lt;br /&gt;
	&lt;br /&gt;
	if wikidataSitelink then&lt;br /&gt;
		-- we do have a sitelink at Wikidata&lt;br /&gt;
		setFalse()&lt;br /&gt;
	elseif yesno(args.nocat, true) then&lt;br /&gt;
		-- we have a |nocat parameter&lt;br /&gt;
		setFalse()&lt;br /&gt;
	elseif page.namespace ~= 0 then&lt;br /&gt;
		-- only care about mainspace&lt;br /&gt;
		setFalse()&lt;br /&gt;
	elseif string.match(pagename, &amp;#039;^Lists? of &amp;#039;) then&lt;br /&gt;
		-- we are on a list page, and those should not have Wikisource links&lt;br /&gt;
		setFalse()&lt;br /&gt;
	elseif string.match(pagename, &amp;#039;^%d%d?%d?%d?s? in&amp;#039;) then&lt;br /&gt;
		-- we are in a YEAR/DECADE in FOO page, and those also should not have anything else&lt;br /&gt;
		setFalse()&lt;br /&gt;
	else&lt;br /&gt;
		-- Now we check categories and determine whether this is something which does not need a Wikisource links&lt;br /&gt;
		-- Currently, we avoid categorizing:&lt;br /&gt;
		-- 1. Disambiguation pages&lt;br /&gt;
		-- 2. Set index articles&lt;br /&gt;
		-- 3. Articles about species. There is no universal category; [[Category:Articles with &amp;#039;species&amp;#039; microformats]] is a proxy&lt;br /&gt;
		-- we do this check last to avoid using [[WP:EXPENSIVE]] parser calls if possible&lt;br /&gt;
		for _, cat in ipairs(page.categories) do&lt;br /&gt;
			if cat == &amp;quot;All disambiguation pages&amp;quot; or cat == &amp;quot;All set index articles&amp;quot; or cat == &amp;quot;Articles with &amp;#039;species&amp;#039; microformats&amp;quot; then&lt;br /&gt;
				setFalse()&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- build the link&lt;br /&gt;
	toReturn = &amp;#039;[[:s:&amp;#039; .. lang .. &amp;#039;:&amp;#039; .. prefix .. linkTarget .. &amp;#039;|&amp;#039; .. displayText .. &amp;#039;]]&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	-- append the error category if needed&lt;br /&gt;
	if errorCategory then&lt;br /&gt;
		toReturn = toReturn .. &amp;#039;[[Category:Wikisource templates with missing id|&amp;#039; .. pagename .. &amp;#039;]]&amp;#039; &lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return toReturn&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;HouseBlaster</name></author>
	</entry>
</feed>