Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dedent ¶
Dedent removes leading whitespace indentation from each line in the text.
Whitespace is removed according to smallest whitespace prefix of a determining line. A determining line is a line that has at least 1 non-space character. The algorithm is:
- If the first line is whitespace, discard it. - If the last line is whitespace, discard it. - For each remaining line:
- If the line only has whitespace, replace it with a single newline.
- If the line has non-whitespace chars, find the common whitespace prefix of all such lines.
- Remove the common whitespace prefix from each line.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.