<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://fanverse.click/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://fanverse.click/index.php?action=history&amp;feed=atom&amp;title=Module%3AEscape"/>
	<link rel="alternate" type="text/html" href="https://fanverse.click/index.php?title=Module:Escape&amp;action=history"/>
	<updated>2026-04-14T15:26:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://fanverse.click/index.php?title=Module:Escape&amp;diff=4643&amp;oldid=prev</id>
		<title>Mob: 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;):format( 			(&#039;%x%s%s&#039;):format(chr:byte(), safe, safe), 			(&#039;%s%x&#039;):format(safe, chr:byte()) 		) 		if not self[self[1]] then 			self[self[1]] = { 				char = chr, 				text = (&#039;%s(.)&#039;):format(chr), 				undo = self[1]:format&#039;(%d+)&#039; 			} 		end 		return args.text and self:text(args.text) 			or args.undo and...&quot;</title>
		<link rel="alternate" type="text/html" href="https://fanverse.click/index.php?title=Module:Escape&amp;diff=4643&amp;oldid=prev"/>
		<updated>2024-12-30T15:36:50Z</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;):format( 			(&amp;#039;%x%s%s&amp;#039;):format(chr:byte(), safe, safe), 			(&amp;#039;%s%x&amp;#039;):format(safe, chr:byte()) 		) 		if not self[self[1]] then 			self[self[1]] = { 				char = chr, 				text = (&amp;#039;%s(.)&amp;#039;):format(chr), 				undo = self[1]:format&amp;#039;(%d+)&amp;#039; 			} 		end 		return args.text and self:text(args.text) 			or args.undo and...&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>Mob</name></author>
	</entry>
</feed>