Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21fcab35c1899fe

Jump to content

Module:Unindent/doc

From Wikipedia, the free encyclopedia

Unindent resets the indentation level of mulitline strings. It is useful for multiline strings inside functions and large tables. This module serves as a utility function for string parsing.

Lua supports multiline strings in the format [[\n...\n]]. In general, Lua does not outdent indented multiline strings out of the box. Though Lua supports variable indentation in multiline strings, custom logic is necessary to reset the string's indentation. This module adopts a flexible approach based on string scanning.

Unlike Penlight's pl.text.dedent behaviour where every line has the indentation of the first line removed, the line prefixed with the least non-tab whitespace is reset to zero indentation. Thus, the opening line of the string may retain some indentation if there are lines of less indentation terminating the string.

Documentation

Package function

unindent( str ) (function)
Unindent resets the indentation level of mulitline strings.
Parameter: str Multiline string indented consistently. (string)
Returns: Unindented string. (string)

Documentation above is auto generated

Module information card (autogenerated)
NameValue
Variableunindent(str)
CodeModule:Unindent
Release statusstable
DescriptionUnindent resets the indentation level of mulitline strings.
Author 8nml
Using code by@kikito (GitHub)