<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://the.satanic.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnindent</id>
	<title>Module:Unindent - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://the.satanic.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnindent"/>
	<link rel="alternate" type="text/html" href="https://the.satanic.wiki/index.php?title=Module:Unindent&amp;action=history"/>
	<updated>2026-04-20T04:35:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://the.satanic.wiki/index.php?title=Module:Unindent&amp;diff=10968&amp;oldid=prev</id>
		<title>WikiGOD: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://the.satanic.wiki/index.php?title=Module:Unindent&amp;diff=10968&amp;oldid=prev"/>
		<updated>2021-04-30T02:24:05Z</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;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 02:24, 30 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key zzegtzyr_mw19226-mwjf_:diff:1.41:old-10967:rev-10968 --&gt;
&lt;/table&gt;</summary>
		<author><name>WikiGOD</name></author>
	</entry>
	<entry>
		<id>https://the.satanic.wiki/index.php?title=Module:Unindent&amp;diff=10967&amp;oldid=prev</id>
		<title>Mediawiki&gt;8nml: Renaming</title>
		<link rel="alternate" type="text/html" href="https://the.satanic.wiki/index.php?title=Module:Unindent&amp;diff=10967&amp;oldid=prev"/>
		<updated>2020-06-06T21:56:00Z</updated>

		<summary type="html">&lt;p&gt;Renaming&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
    Copyright (c) 2013 Enrique García Cota&lt;br /&gt;
    &lt;br /&gt;
    Permission is hereby granted, free of charge, to any person obtaining a&lt;br /&gt;
    copy of this software and associated documentation files (the&lt;br /&gt;
    &amp;quot;Software&amp;quot;), to deal in the Software without restriction, including&lt;br /&gt;
    without limitation the rights to use, copy, modify, merge, publish,&lt;br /&gt;
    distribute, sublicense, and/or sell copies of the Software, and to&lt;br /&gt;
    permit persons to whom the Software is furnished to do so, subject to&lt;br /&gt;
    the following conditions:&lt;br /&gt;
    &lt;br /&gt;
    The above copyright notice and this permission notice shall be included&lt;br /&gt;
    in all copies or substantial portions of the Software.&lt;br /&gt;
    &lt;br /&gt;
    THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS&lt;br /&gt;
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&lt;br /&gt;
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.&lt;br /&gt;
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY&lt;br /&gt;
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,&lt;br /&gt;
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE&lt;br /&gt;
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;br /&gt;
--]]&lt;br /&gt;
-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
--- Unindent resets the indentation level of mulitline strings.&lt;br /&gt;
--  It is useful for multiline strings inside functions and large tables.&lt;br /&gt;
--  This module serves as a utility function for string parsing, [[Global&lt;br /&gt;
--  Lua Modules/Testharness|Testharness]] test suites, [[Global Lua&lt;br /&gt;
--  Modules/I18n|I18n]] datastores.&lt;br /&gt;
--  &lt;br /&gt;
--  Lua supports multiline strings in the format `[[\n...\n]]`. In general,&lt;br /&gt;
--  Lua does not outdent indented multiline strings out of the box. Though&lt;br /&gt;
--  Lua supports variable indentation in multiline strings, custom logic is&lt;br /&gt;
--  necessary to reset the string&amp;#039;s indentation. This module adopts a&lt;br /&gt;
--  flexible approach based on string scanning.&lt;br /&gt;
--  &lt;br /&gt;
--  Unlike Penlight&amp;#039;s `pl.text.dedent` behaviour where every line has the&lt;br /&gt;
--  indentation of the first line removed, the line prefixed with the least&lt;br /&gt;
--  non-tab whitespace is reset to zero indentation. Thus, the opening line&lt;br /&gt;
--  of the string may retain some indentation *if* there are lines of less&lt;br /&gt;
--  indentation terminating the string.&lt;br /&gt;
--  &lt;br /&gt;
--  @script             unindent&lt;br /&gt;
--  @license            MIT&lt;br /&gt;
--  @release            stable&lt;br /&gt;
--  @author             [[User:8nml|8nml]]&lt;br /&gt;
--  @attribution        [[github:kikito|@kikito]] ([[github:kikito/inspect.lua/blob/master/spec/unindent.lua|Github]])&lt;br /&gt;
--  @param              {string} str Multiline string indented consistently.&lt;br /&gt;
--  @returns            {string} Unindented string.&lt;br /&gt;
return function(str)&lt;br /&gt;
    str = str:gsub(&amp;#039; +$&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;^ +&amp;#039;, &amp;#039;&amp;#039;) -- remove spaces at start and end&lt;br /&gt;
    local level = math.huge&lt;br /&gt;
    local minPrefix = &amp;#039;&amp;#039;&lt;br /&gt;
    local len&lt;br /&gt;
    for prefix in str:gmatch(&amp;#039;\n( +)&amp;#039;) do&lt;br /&gt;
        len = #prefix&lt;br /&gt;
        if len &amp;lt; level then&lt;br /&gt;
            level = len&lt;br /&gt;
            minPrefix = prefix&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return (str:gsub(&amp;#039;\n&amp;#039; .. minPrefix, &amp;#039;\n&amp;#039;):gsub(&amp;#039;\n$&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Mediawiki&gt;8nml</name></author>
	</entry>
</feed>