<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.supershiritori.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnsubst</id>
	<title>Module:Unsubst - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.supershiritori.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnsubst"/>
	<link rel="alternate" type="text/html" href="https://wiki.supershiritori.com/index.php?title=Module:Unsubst&amp;action=history"/>
	<updated>2026-09-05T21:11:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.supershiritori.com/index.php?title=Module:Unsubst&amp;diff=6215&amp;oldid=prev</id>
		<title>imported&gt;BlankEntity: Created page with &quot;-- Cannot unsubst if not currently being substed.  if not mw.isSubsting() then 	local frame_title = mw.getCurrentFrame():getTitle()  	-- If another module is calling this one, throw an error. 	if frame_title ~= &quot;Module:unsubst&quot; then 		error((&quot;%s should not require Module:unsubst unless mw.isSubsting() returns true&quot;):format(frame_title)) 	end  	-- Otherwise, enable {{#invoke:unsubst|me|...}}. 	local export = {}  	local process_params = require(&quot;Module:parameters&quot;)...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.supershiritori.com/index.php?title=Module:Unsubst&amp;diff=6215&amp;oldid=prev"/>
		<updated>2026-01-27T01:42:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- Cannot unsubst if not currently being substed.  if not mw.isSubsting() then 	local frame_title = mw.getCurrentFrame():getTitle()  	-- If another module is calling this one, throw an error. 	if frame_title ~= &amp;quot;Module:unsubst&amp;quot; then 		error((&amp;quot;&lt;a href=&quot;/index.php?title=%25s&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;%s (page does not exist)&quot;&gt;%s&lt;/a&gt; should not require &lt;a href=&quot;/wiki/Module:Unsubst&quot; title=&quot;Module:Unsubst&quot;&gt;Module:unsubst&lt;/a&gt; unless mw.isSubsting() returns true&amp;quot;):format(frame_title)) 	end  	-- Otherwise, enable {{#invoke:unsubst|me|...}}. 	local export = {}  	local process_params = require(&amp;quot;Module:parameters&amp;quot;)...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Cannot unsubst if not currently being substed.&lt;br /&gt;
&lt;br /&gt;
if not mw.isSubsting() then&lt;br /&gt;
	local frame_title = mw.getCurrentFrame():getTitle()&lt;br /&gt;
&lt;br /&gt;
	-- If another module is calling this one, throw an error.&lt;br /&gt;
	if frame_title ~= &amp;quot;Module:unsubst&amp;quot; then&lt;br /&gt;
		error((&amp;quot;[[%s]] should not require [[Module:unsubst]] unless mw.isSubsting() returns true&amp;quot;):format(frame_title))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Otherwise, enable {{#invoke:unsubst|me|...}}.&lt;br /&gt;
	local export = {}&lt;br /&gt;
&lt;br /&gt;
	local process_params = require(&amp;quot;Module:parameters&amp;quot;).process&lt;br /&gt;
&lt;br /&gt;
	function export.me(frame)&lt;br /&gt;
		return process_params(frame.args, {&lt;br /&gt;
			[&amp;quot;&amp;quot;] = true&lt;br /&gt;
		})[&amp;quot;&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return export&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local m_pages = require(&amp;quot;Module:pages&amp;quot;)&lt;br /&gt;
local m_template_parser = require(&amp;quot;Module:template parser&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local build_template = m_template_parser.buildTemplate&lt;br /&gt;
local concat = table.concat&lt;br /&gt;
local is_internal_title = m_pages.is_internal_title&lt;br /&gt;
local new_title = mw.title.new&lt;br /&gt;
&lt;br /&gt;
local function get_title(frame)&lt;br /&gt;
	local title = new_title(frame:getTitle())&lt;br /&gt;
	return is_internal_title(title) and title or&lt;br /&gt;
		-- This shouldn&amp;#039;t happen.&lt;br /&gt;
		error(&amp;quot;frame returned an invalid title&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function serialize(title, args)&lt;br /&gt;
	return &amp;quot;{{&amp;quot; .. concat(build_template(title, args), &amp;quot;|&amp;quot;) .. &amp;quot;}}&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local mt = {}&lt;br /&gt;
&lt;br /&gt;
if m_pages.is_transcluded() then&lt;br /&gt;
	local get_template_invocation_name = m_template_parser.getTemplateInvocationName&lt;br /&gt;
&lt;br /&gt;
	function mt:__index(entry_point)&lt;br /&gt;
		return function(frame)&lt;br /&gt;
			frame = frame:getParent()&lt;br /&gt;
			return serialize(get_template_invocation_name(get_title(frame)), frame.args)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
else&lt;br /&gt;
	function mt:__index(entry_point)&lt;br /&gt;
		return function(frame)&lt;br /&gt;
			local title = get_title(frame)&lt;br /&gt;
			return title.namespace == 828 and&lt;br /&gt;
				(serialize((&amp;quot;safesubst:&amp;lt;noinclude/&amp;gt;#invoke:%s|%s&amp;quot;):format(title.text, entry_point), frame.args)) or&lt;br /&gt;
				-- This shouldn&amp;#039;t happen.&lt;br /&gt;
				error((&amp;quot;[[Module:unsubst]] cannot work if the current frame is not in the %s namespace, because the #invoke magic word requires it&amp;quot;):format(mw.site.namespaces[828].canonicalName))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return setmetatable({}, mt)&lt;/div&gt;</summary>
		<author><name>imported&gt;BlankEntity</name></author>
	</entry>
</feed>