<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Astring%2Fnowiki</id>
	<title>Module:string/nowiki - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Astring%2Fnowiki"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/nowiki&amp;action=history"/>
	<updated>2026-04-08T09:12:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:string/nowiki&amp;diff=433723&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;local byte = string.byte local concat = table.concat local gsub = string.gsub local lower = string.lower local match = string.match local sub = string.sub  local data = mw.loadData(&quot;Module:string/nowiki/data&quot;) local absolute = data.absolute local after_newline = data.after_newline local after_magic_link = data.after_magic_link local first = data.first local last = data.last local uri_schemes = data.uri_schemes  local function escape_uri(uri, colon) 	return colon == &quot;&quot; an...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/nowiki&amp;diff=433723&amp;oldid=prev"/>
		<updated>2025-01-22T16:14:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local byte = string.byte local concat = table.concat local gsub = string.gsub local lower = string.lower local match = string.match local sub = string.sub  local data = mw.loadData(&amp;quot;Module:string/nowiki/data&amp;quot;) local absolute = data.absolute local after_newline = data.after_newline local after_magic_link = data.after_magic_link local first = data.first local last = data.last local uri_schemes = data.uri_schemes  local function escape_uri(uri, colon) 	return colon == &amp;quot;&amp;quot; an...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local byte = string.byte&lt;br /&gt;
local concat = table.concat&lt;br /&gt;
local gsub = string.gsub&lt;br /&gt;
local lower = string.lower&lt;br /&gt;
local match = string.match&lt;br /&gt;
local sub = string.sub&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData(&amp;quot;Module:string/nowiki/data&amp;quot;)&lt;br /&gt;
local absolute = data.absolute&lt;br /&gt;
local after_newline = data.after_newline&lt;br /&gt;
local after_magic_link = data.after_magic_link&lt;br /&gt;
local first = data.first&lt;br /&gt;
local last = data.last&lt;br /&gt;
local uri_schemes = data.uri_schemes&lt;br /&gt;
&lt;br /&gt;
local function escape_uri(uri, colon)&lt;br /&gt;
	return colon == &amp;quot;&amp;quot; and uri or uri .. (uri_schemes[lower(uri)] and &amp;quot;&amp;amp;#58;&amp;quot; or &amp;quot;:&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return function(str)&lt;br /&gt;
	local ret, head, n, ch_first = {}, 1, 0, sub(str, 1, 1)&lt;br /&gt;
	if after_newline[ch_first] or first[ch_first] then&lt;br /&gt;
		n = n + 1&lt;br /&gt;
		ret[n] = &amp;quot;&amp;amp;#&amp;quot; .. byte(ch_first) .. &amp;quot;;&amp;quot;&lt;br /&gt;
		head = 2&lt;br /&gt;
	elseif sub(str, 1, 4) == &amp;quot;----&amp;quot; then&lt;br /&gt;
		n = n + 1&lt;br /&gt;
		ret[n] = &amp;quot;&amp;amp;#45;---&amp;quot;&lt;br /&gt;
		head = 5&lt;br /&gt;
	end&lt;br /&gt;
	local start = head&lt;br /&gt;
	while true do&lt;br /&gt;
		local loc, this = match(str, &amp;quot;()([\n\r!\&amp;quot;&amp;amp;&amp;#039;:;&amp;lt;=&amp;gt;IPR[%]_{|}~])&amp;quot;, head)&lt;br /&gt;
		if not loc then&lt;br /&gt;
			n = n + 1&lt;br /&gt;
			ret[n] = sub(str, start)&lt;br /&gt;
			-- (:?) is an optimization that resets the match head to the end of&lt;br /&gt;
			-- the [%w_]+ string, instead of backtracking to the next character.&lt;br /&gt;
			str = gsub(concat(ret), &amp;quot;([%w_]+)(:?)&amp;quot;, escape_uri)&lt;br /&gt;
			local ch_last = sub(str, -1)&lt;br /&gt;
			return last[ch_last] and sub(str, 1, -2) .. &amp;quot;&amp;amp;#&amp;quot; .. byte(ch_last) .. &amp;quot;;&amp;quot; or str&lt;br /&gt;
		elseif absolute[this] then&lt;br /&gt;
			n = n + 1&lt;br /&gt;
			ret[n] = sub(str, start, loc - 1) .. &amp;quot;&amp;amp;#&amp;quot; .. byte(this) .. &amp;quot;;&amp;quot;&lt;br /&gt;
			head = loc + 1&lt;br /&gt;
			start = head&lt;br /&gt;
		elseif this == &amp;quot;\n&amp;quot; or this == &amp;quot;\r&amp;quot; then&lt;br /&gt;
			local nxt = loc + 1&lt;br /&gt;
			nxt = sub(str, nxt, nxt)&lt;br /&gt;
			if after_newline[nxt] then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc) .. &amp;quot;&amp;amp;#&amp;quot; .. byte(nxt) .. &amp;quot;;&amp;quot;&lt;br /&gt;
				head = loc + 2&lt;br /&gt;
				start = head&lt;br /&gt;
			elseif sub(str, loc + 1, loc + 4) == &amp;quot;----&amp;quot; then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc) .. &amp;quot;&amp;amp;#45;---&amp;quot;&lt;br /&gt;
				head = loc + 5&lt;br /&gt;
				start = head&lt;br /&gt;
			else&lt;br /&gt;
				head = head + 1&lt;br /&gt;
			end&lt;br /&gt;
		elseif this == &amp;quot;!&amp;quot; then&lt;br /&gt;
			local nxt = loc + 1&lt;br /&gt;
			if sub(str, nxt, nxt) == &amp;quot;!&amp;quot; then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc - 1) .. &amp;quot;&amp;amp;#33;!&amp;quot;&lt;br /&gt;
				head = loc + 2&lt;br /&gt;
				start = head&lt;br /&gt;
			else&lt;br /&gt;
				head = head + 1&lt;br /&gt;
			end&lt;br /&gt;
		elseif this == &amp;quot;_&amp;quot; then&lt;br /&gt;
			local nxt = loc + 1&lt;br /&gt;
			if sub(str, nxt, nxt) == &amp;quot;_&amp;quot; then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc) .. &amp;quot;&amp;amp;#95;&amp;quot;&lt;br /&gt;
				head = loc + 2&lt;br /&gt;
				start = head&lt;br /&gt;
			else&lt;br /&gt;
				head = head + 1&lt;br /&gt;
			end&lt;br /&gt;
		elseif this == &amp;quot;:&amp;quot; and sub(str, loc + 1, loc + 2) == &amp;quot;//&amp;quot; then&lt;br /&gt;
			n = n + 1&lt;br /&gt;
			ret[n] = sub(str, start, loc - 1) .. &amp;quot;&amp;amp;#58;//&amp;quot;&lt;br /&gt;
			head = loc + 3&lt;br /&gt;
			start = head&lt;br /&gt;
		elseif this == &amp;quot;~&amp;quot; and sub(str, loc + 1, loc + 2) == &amp;quot;~~&amp;quot; then&lt;br /&gt;
			n = n + 1&lt;br /&gt;
			ret[n] = sub(str, start, loc + 1) .. &amp;quot;&amp;amp;#126;&amp;quot;&lt;br /&gt;
			head = loc + 3&lt;br /&gt;
			start = head&lt;br /&gt;
		elseif (&lt;br /&gt;
			this == &amp;quot;I&amp;quot; and sub(str, loc + 1, loc + 3) == &amp;quot;SBN&amp;quot; or&lt;br /&gt;
			this == &amp;quot;P&amp;quot; and sub(str, loc + 1, loc + 3) == &amp;quot;MID&amp;quot;&lt;br /&gt;
		) then&lt;br /&gt;
			local nxt = loc + 4&lt;br /&gt;
			nxt = sub(str, nxt, nxt)&lt;br /&gt;
			if after_magic_link[nxt] then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc + 3)  .. &amp;quot;&amp;amp;#&amp;quot; .. byte(nxt) .. &amp;quot;;&amp;quot;&lt;br /&gt;
				head = loc + 5&lt;br /&gt;
				start = head&lt;br /&gt;
			else&lt;br /&gt;
				head = head + 1&lt;br /&gt;
			end&lt;br /&gt;
		elseif this == &amp;quot;R&amp;quot; and sub(str, loc + 1, loc + 2) == &amp;quot;FC&amp;quot; then&lt;br /&gt;
			local nxt = loc + 3&lt;br /&gt;
			nxt = sub(str, nxt, nxt)&lt;br /&gt;
			if after_magic_link[nxt] then&lt;br /&gt;
				n = n + 1&lt;br /&gt;
				ret[n] = sub(str, start, loc + 2)  .. &amp;quot;&amp;amp;#&amp;quot; .. byte(nxt) .. &amp;quot;;&amp;quot;&lt;br /&gt;
				head = loc + 4&lt;br /&gt;
				start = head&lt;br /&gt;
			else&lt;br /&gt;
				head = head + 1&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			head = head + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
</feed>