normalize_eols
Take a block of raw text that will be passed through str.splitlines() to get universal newlines treatment.
Return the resulting block of text with normalized \n EOL sequences ready to be written to disk using current platform's native EOLs.
def normalize_eols(
raw_contents: string
) - > string
Take a block of raw text that will be passed through str.splitlines() to get universal newlines treatment. Return the resulting block of text with normalized \n EOL sequences ready to be written to disk using current platform's native EOLs.
Parameters
| Name | Type | Description |
|---|---|---|
| raw_contents | string | The block of raw text containing inconsistent or platform-specific end-of-line characters to be normalized. |
Returns
| Type | Description |
|---|---|
string | The resulting block of text with normalized \n EOL sequences, including a trailing newline if the input was not empty. |