<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3AEscape</id>
	<title>Module:Escape - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3AEscape"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Escape&amp;action=history"/>
	<updated>2026-04-07T23:32:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Escape&amp;diff=11806&amp;oldid=prev</id>
		<title>Caleb Cooper at 12:29, 16 October 2020</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Escape&amp;diff=11806&amp;oldid=prev"/>
		<updated>2020-10-16T12:29:15Z</updated>

		<summary type="html">&lt;p&gt;&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:29, 16 October 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&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;	exec = function(self, text, mode, newEscape)&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;	exec = function(self, text, mode, newEscape)&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 target = self[self[1] or self:char() and self[1]]&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 target = self[self[1] or self:char() and self[1]]&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;		for v in text:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;gfind&lt;/del&gt;(target[mode]) do&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;		for v in text:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;gmatch&lt;/ins&gt;(target[mode]) do&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;			text = text:gsub(&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;			text = text:gsub(&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;				mode == &#039;text&#039; and&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;				mode == &#039;text&#039; and&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Escape&amp;diff=11778&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot;local escape = { 	char = function(self, chr, args) 		args = args or {} 		local safe = args.safeChr or string.char(13) 		chr = tostring(chr or &#039;\\&#039;) 		self[1] = (&#039;%s0%%s%s&#039;):fo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Escape&amp;diff=11778&amp;oldid=prev"/>
		<updated>2020-10-16T11:13:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local escape = { 	char = function(self, chr, args) 		args = args or {} 		local safe = args.safeChr or string.char(13) 		chr = tostring(chr or &amp;#039;\\&amp;#039;) 		self[1] = (&amp;#039;%s0%%s%s&amp;#039;):fo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local escape = {&lt;br /&gt;
	char = function(self, chr, args)&lt;br /&gt;
		args = args or {}&lt;br /&gt;
		local safe = args.safeChr or string.char(13)&lt;br /&gt;
		chr = tostring(chr or &amp;#039;\\&amp;#039;)&lt;br /&gt;
		self[1] = (&amp;#039;%s0%%s%s&amp;#039;):format(&lt;br /&gt;
			(&amp;#039;%x%s%s&amp;#039;):format(chr:byte(), safe, safe),&lt;br /&gt;
			(&amp;#039;%s%x&amp;#039;):format(safe, chr:byte())&lt;br /&gt;
		)&lt;br /&gt;
		if not self[self[1]] then&lt;br /&gt;
			self[self[1]] = {&lt;br /&gt;
				char = chr,&lt;br /&gt;
				text = (&amp;#039;%s(.)&amp;#039;):format(chr),&lt;br /&gt;
				undo = self[1]:format&amp;#039;(%d+)&amp;#039;&lt;br /&gt;
			}&lt;br /&gt;
		end&lt;br /&gt;
		return args.text and self:text(args.text)&lt;br /&gt;
			or args.undo and self:undo(args.undo, chr)&lt;br /&gt;
			or args.kill and self:kill(args.kill)&lt;br /&gt;
			or self&lt;br /&gt;
	end,&lt;br /&gt;
	exec = function(self, text, mode, newEscape)&lt;br /&gt;
		local target = self[self[1] or self:char() and self[1]]&lt;br /&gt;
		for v in text:gfind(target[mode]) do&lt;br /&gt;
			text = text:gsub(&lt;br /&gt;
				mode == &amp;#039;text&amp;#039; and&lt;br /&gt;
					(&amp;#039;%s%s&amp;#039;):format(target.char, v:gsub(&amp;#039;%W&amp;#039;, &amp;#039;%%%1&amp;#039;))&lt;br /&gt;
					or self[1]:format(v),&lt;br /&gt;
				mode == &amp;#039;text&amp;#039; and&lt;br /&gt;
					self[1]:format(v:byte())&lt;br /&gt;
					or (newEscape or &amp;#039;&amp;#039;) .. v:char()&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
		return text&lt;br /&gt;
	end,&lt;br /&gt;
	text = function(self, text)&lt;br /&gt;
		return self:exec(type(text) == &amp;#039;table&amp;#039; and text[1] or text, &amp;#039;text&amp;#039;)&lt;br /&gt;
	end,&lt;br /&gt;
	undo = function(self, text, newEscape)&lt;br /&gt;
		if type(text) == &amp;#039;table&amp;#039; then&lt;br /&gt;
			text, newEscape = unpack(text)&lt;br /&gt;
		end&lt;br /&gt;
		return self:exec(text, &amp;#039;undo&amp;#039;, newEscape)&lt;br /&gt;
	end,&lt;br /&gt;
	kill = function(self, text, chars, newEscape)&lt;br /&gt;
		if type(text) == &amp;#039;table&amp;#039; then&lt;br /&gt;
			text, chars, newEscape = unpack(text)&lt;br /&gt;
		end&lt;br /&gt;
		return self:undo(self:text(text):gsub(chars or &amp;#039;&amp;#039;, &amp;#039;&amp;#039;), newEscape)&lt;br /&gt;
	end&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function escape.main(frame)&lt;br /&gt;
	local args, family = {}, {frame:getParent(), frame}&lt;br /&gt;
	for f = 1, 2 do&lt;br /&gt;
		for k, v in pairs(family[f] and family[f].args or {}) do&lt;br /&gt;
			args[k] = args[k] or v:match(&amp;#039;^%s*(.-)%s*$&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if args.mode == &amp;#039;char&amp;#039; then&lt;br /&gt;
		return escape:char(args.char or args[2], args)&lt;br /&gt;
	end&lt;br /&gt;
	return escape[args.mode](escape:char(args.char), args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return escape&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>