<?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%3ABad_title_suggestion</id>
	<title>Module:Bad title suggestion - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ABad_title_suggestion"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Bad_title_suggestion&amp;action=history"/>
	<updated>2026-04-21T04:50:03Z</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:Bad_title_suggestion&amp;diff=135354&amp;oldid=prev</id>
		<title>imported&gt;Izno: add mw-parser-output</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Bad_title_suggestion&amp;diff=135354&amp;oldid=prev"/>
		<updated>2022-08-29T23:38:59Z</updated>

		<summary type="html">&lt;p&gt;add mw-parser-output&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	-- The invalid character, e.g. &amp;quot;&amp;gt;&amp;quot; or &amp;quot;}&amp;quot;&lt;br /&gt;
	local chr = args[1]&lt;br /&gt;
	-- The escaped bad title, e.g. &amp;quot;Foobar&amp;amp;#62;&amp;quot; or &amp;quot;Foobar&amp;amp;#124;text&amp;quot;&lt;br /&gt;
	local title = args[2]&lt;br /&gt;
	-- A pipe (|) as the invalid character is a special case; it is not&lt;br /&gt;
	-- escaped, so instead the module thinks it got two empty arguments&lt;br /&gt;
	-- and the title as the third argument.&lt;br /&gt;
	if chr == nil and title == nil then&lt;br /&gt;
		chr = &amp;quot;|&amp;quot;&lt;br /&gt;
		title = args[3]&lt;br /&gt;
	end&lt;br /&gt;
	if chr == nil or title == nil then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Determine the suggested title by taking a prefix of the bad title&lt;br /&gt;
	-- up to the first invalid character. Only display the suggestion box&lt;br /&gt;
	-- if the page exists.&lt;br /&gt;
	local index = mw.ustring.find(title, mw.text.nowiki(chr), 1, true)&lt;br /&gt;
	if index == nil then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local page = mw.title.new(mw.ustring.sub(title, 1, index - 1))&lt;br /&gt;
	if page == nil or not page.exists then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;mw-parser-output&amp;quot;&amp;gt;&amp;#039; .. frame:expandTemplate{&lt;br /&gt;
		title = &amp;quot;Did you mean box&amp;quot;,&lt;br /&gt;
		args = { page.fullText }&lt;br /&gt;
	} .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Izno</name></author>
	</entry>
</feed>