<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindpowe.red/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3APlain_text</id>
	<title>Module:Plain text - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindpowe.red/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3APlain_text"/>
	<link rel="alternate" type="text/html" href="https://mindpowe.red/wiki/index.php?title=Module:Plain_text&amp;action=history"/>
	<updated>2026-04-06T12:40:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://mindpowe.red/wiki/index.php?title=Module:Plain_text&amp;diff=1703&amp;oldid=prev</id>
		<title>imported&gt;Galobtter: better stripping, strip out more stuff</title>
		<link rel="alternate" type="text/html" href="https://mindpowe.red/wiki/index.php?title=Module:Plain_text&amp;diff=1703&amp;oldid=prev"/>
		<updated>2019-01-21T08:22:28Z</updated>

		<summary type="html">&lt;p&gt;better stripping, strip out more stuff&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--converts text with wikilinks to plain text, e.g &amp;quot;[[foo|gah]] is [[bar]]&amp;quot; to &amp;quot;gah is bar&amp;quot;&lt;br /&gt;
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local text = frame.args[1]&lt;br /&gt;
	return p._main(text)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(text)&lt;br /&gt;
	if not text then return end&lt;br /&gt;
	text = mw.text.killMarkers(text)&lt;br /&gt;
		:gsub('&amp;amp;nbsp;', ' ') --replace nbsp spaces with regular spaces&lt;br /&gt;
		:gsub('&amp;lt;br ?/?&amp;gt;', ', ') --replace br with commas&lt;br /&gt;
		:gsub('&amp;lt;span.-&amp;gt;(.-)&amp;lt;/span&amp;gt;', '%1') --remove spans while keeping text inside&lt;br /&gt;
		:gsub('&amp;lt;i.-&amp;gt;(.-)&amp;lt;/i&amp;gt;', '%1') --remove italics while keeping text inside&lt;br /&gt;
		:gsub('&amp;lt;.-&amp;gt;.-&amp;lt;.-&amp;gt;', '') --strip out remaining tags and the text inside&lt;br /&gt;
		:gsub('&amp;lt;.-&amp;gt;', '') --remove any other tag markup&lt;br /&gt;
		:gsub('%[%[%s*[Ff]ile%s*:.-%]%]', '') --strip out files&lt;br /&gt;
		:gsub('%[%[%s*[Ii]mage%s*:.-%]%]', '') --strip out use of image:&lt;br /&gt;
		:gsub('%[%[%s*[Cc]ategory%s*:.-%]%]', '') --strip out categories&lt;br /&gt;
		:gsub('%[%[[^%]]-|', '') --strip out piped link text&lt;br /&gt;
		:gsub('[%[%]]', '') --then strip out remaining [ and ]&lt;br /&gt;
		:gsub(&amp;quot;'''''&amp;quot;, &amp;quot;&amp;quot;) --strip out bold italic markup&lt;br /&gt;
		:gsub(&amp;quot;'''?&amp;quot;, &amp;quot;&amp;quot;) --not stripping out '''' gives correct output for bolded text in quotes&lt;br /&gt;
		:gsub('----', '') --remove ---- lines&lt;br /&gt;
		:gsub(&amp;quot;^%s+&amp;quot;, &amp;quot;&amp;quot;) --strip leading&lt;br /&gt;
		:gsub(&amp;quot;%s+$&amp;quot;, &amp;quot;&amp;quot;) --and trailing spaces&lt;br /&gt;
		:gsub(&amp;quot;%s+&amp;quot;, &amp;quot; &amp;quot;) --strip redundant spaces&lt;br /&gt;
	return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Galobtter</name></author>
		
	</entry>
</feed>