<?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%2Fgline</id>
	<title>Module:string/gline - 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%2Fgline"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/gline&amp;action=history"/>
	<updated>2026-04-06T02:52:46Z</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/gline&amp;diff=474949&amp;oldid=prev</id>
		<title>Sware: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/gline&amp;diff=474949&amp;oldid=prev"/>
		<updated>2025-11-04T17:47:25Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:47, 4 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:string/gline&amp;diff=461121&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;local error = error local find = string.find local gmatch = string.gmatch local match = string.match local sub = string.sub  --[==[ Iterates over the lines in a string, treating {&quot;\n&quot;}, {&quot;\r&quot;} and {&quot;\r\n&quot;} as new lines.  The optional {skip} parameter determines whether certain lines are skipped: * {NONE}: none (default). * {EMPTY}: empty lines: lines with a length of 0, consisting of no characters. * {BLANK}: blank lines: empty lines and lines which only consist of white...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/gline&amp;diff=461121&amp;oldid=prev"/>
		<updated>2025-07-01T23:35:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local error = error local find = string.find local gmatch = string.gmatch local match = string.match local sub = string.sub  --[==[ Iterates over the lines in a string, treating {&amp;quot;\n&amp;quot;}, {&amp;quot;\r&amp;quot;} and {&amp;quot;\r\n&amp;quot;} as new lines.  The optional {skip} parameter determines whether certain lines are skipped: * {NONE}: none (default). * {EMPTY}: empty lines: lines with a length of 0, consisting of no characters. * {BLANK}: blank lines: empty lines and lines which only consist of white...&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:35, 1 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:string/gline&amp;diff=474948&amp;oldid=prev</id>
		<title>wikt&gt;Theknightwho at 09:11, 27 May 2025</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:string/gline&amp;diff=474948&amp;oldid=prev"/>
		<updated>2025-05-27T09:11:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local error = error&lt;br /&gt;
local find = string.find&lt;br /&gt;
local gmatch = string.gmatch&lt;br /&gt;
local match = string.match&lt;br /&gt;
local sub = string.sub&lt;br /&gt;
&lt;br /&gt;
--[==[&lt;br /&gt;
Iterates over the lines in a string, treating {&amp;quot;\n&amp;quot;}, {&amp;quot;\r&amp;quot;} and {&amp;quot;\r\n&amp;quot;} as new lines.&lt;br /&gt;
&lt;br /&gt;
The optional {skip} parameter determines whether certain lines are skipped:&lt;br /&gt;
* {NONE}: none (default).&lt;br /&gt;
* {EMPTY}: empty lines: lines with a length of 0, consisting of no characters.&lt;br /&gt;
* {BLANK}: blank lines: empty lines and lines which only consist of whitespace characters.]==]&lt;br /&gt;
return function(str, skip)&lt;br /&gt;
	-- Use gmatch() for EMPTY and BLANK, for speed.&lt;br /&gt;
	if skip == &amp;quot;EMPTY&amp;quot; then&lt;br /&gt;
		return gmatch(str, &amp;quot;[^\n\r]+&amp;quot;)&lt;br /&gt;
	elseif skip == &amp;quot;BLANK&amp;quot; then&lt;br /&gt;
		return gmatch(str, &amp;quot;[^\n\r]-%S[^\n\r]*&amp;quot;)&lt;br /&gt;
	elseif not (skip == nil or skip == &amp;quot;NONE&amp;quot;) then&lt;br /&gt;
		error(&amp;quot;bad argument #2 to &amp;#039;string/gline&amp;#039; (expected NONE, EMPTY or BLANK)&amp;quot;, 2)&lt;br /&gt;
	end&lt;br /&gt;
	local start, linechar, flag = 1&lt;br /&gt;
	if not find(str, &amp;quot;\n&amp;quot;, nil, true) then&lt;br /&gt;
		if not find(str, &amp;quot;\r&amp;quot;, nil, true) then&lt;br /&gt;
			-- No newlines: return `str` on the first iteration then end.&lt;br /&gt;
			return function()&lt;br /&gt;
				if flag then&lt;br /&gt;
					return&lt;br /&gt;
				end&lt;br /&gt;
				flag = true&lt;br /&gt;
				return str&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		linechar = &amp;quot;\r&amp;quot;&lt;br /&gt;
	elseif find(str, &amp;quot;\r&amp;quot;, nil, true) then&lt;br /&gt;
		-- Newline could be &amp;quot;\n&amp;quot;, &amp;quot;\r&amp;quot; or &amp;quot;\r\n&amp;quot; (but not &amp;quot;\n\r&amp;quot;).&lt;br /&gt;
		return function()&lt;br /&gt;
			if not flag then&lt;br /&gt;
				local line, nl, pos = match(str, &amp;quot;^([^\n\r]*)([\n\r]\n?)()&amp;quot;, start)&lt;br /&gt;
				if not line then&lt;br /&gt;
					flag = true&lt;br /&gt;
					return sub(str, start)&lt;br /&gt;
				end&lt;br /&gt;
				-- If `nl` is &amp;quot;\r\n&amp;quot; it should be treated as a single newline,&lt;br /&gt;
				-- but if it&amp;#039;s &amp;quot;\n\n&amp;quot; it needs to be treated as two separate&lt;br /&gt;
				-- newlines, so set `flag` to 2 to avoid an unnecessary match()&lt;br /&gt;
				-- call on the next iteration.&lt;br /&gt;
				if nl == &amp;quot;\n\n&amp;quot; then&lt;br /&gt;
					flag = 2&lt;br /&gt;
				end&lt;br /&gt;
				start = pos&lt;br /&gt;
				return line&lt;br /&gt;
			elseif flag == 2 then&lt;br /&gt;
				flag = nil&lt;br /&gt;
				return &amp;quot;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		linechar = &amp;quot;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	-- Newline is either &amp;quot;\n&amp;quot; or &amp;quot;\r&amp;quot;, depending on which has been found.&lt;br /&gt;
	return function()&lt;br /&gt;
		if flag then&lt;br /&gt;
			return&lt;br /&gt;
		end&lt;br /&gt;
		local pos = find(str, linechar, start, true)&lt;br /&gt;
		if not pos then&lt;br /&gt;
			flag = true&lt;br /&gt;
			return sub(str, start)&lt;br /&gt;
		end&lt;br /&gt;
		local line = sub(str, start, pos - 1)&lt;br /&gt;
		start = pos + 1&lt;br /&gt;
		return line&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>wikt&gt;Theknightwho</name></author>
	</entry>
</feed>