<?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%3ASandbox%2FThe_Earwig%2FAfC_submission</id>
	<title>Module:Sandbox/The Earwig/AfC submission - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FThe_Earwig%2FAfC_submission"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/The_Earwig/AfC_submission&amp;action=history"/>
	<updated>2026-04-21T17:56:27Z</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:Sandbox/The_Earwig/AfC_submission&amp;diff=146303&amp;oldid=prev</id>
		<title>imported&gt;The Earwig: prototype main template detection</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/The_Earwig/AfC_submission&amp;diff=146303&amp;oldid=prev"/>
		<updated>2021-02-17T02:53:07Z</updated>

		<summary type="html">&lt;p&gt;prototype main template detection&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;
&lt;br /&gt;
-- local templateRegex = &amp;quot;[Aa][Ff][Cc] submission&amp;quot;&lt;br /&gt;
local templateRegex = &amp;quot;User:The Earwig/Sandbox/AfC submission&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- Is this the first submission template on the page?&lt;br /&gt;
-- Later templates emit nothing, only recording the submission state.&lt;br /&gt;
local function isMainTemplate(args, text)&lt;br /&gt;
	local match = mw.ustring.match(text, &amp;quot;%{%{%s*&amp;quot;..templateRegex..&amp;quot;.-%|%s*ts%s*=([^|}]*)&amp;quot;)&lt;br /&gt;
	return match == args.ts&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Render the AfC submission template.&lt;br /&gt;
local function render(frame, args, text)&lt;br /&gt;
	return frame:expandTemplate{ title = &amp;quot;AfC submission&amp;quot;, args = args }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local text = mw.title.getCurrentTitle():getContent()&lt;br /&gt;
	if isMainTemplate(args, text) then&lt;br /&gt;
		return render(frame, args, text)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;The Earwig</name></author>
	</entry>
</feed>