Normalize a string to Unix line separators. Preserve character offset by replacing with spaces if preserve is True.
(text, preserve=False)
| 71 | |
| 72 | |
| 73 | def unixlinesep(text, preserve=False): |
| 74 | """ |
| 75 | Normalize a string to Unix line separators. Preserve character offset by |
| 76 | replacing with spaces if preserve is True. |
| 77 | """ |
| 78 | if not isinstance(text, str): |
| 79 | text = as_unicode(text) |
| 80 | return text.replace(CRLF, CRLF_NO_CR if preserve else LF).replace(CR, LF) |
| 81 | |
| 82 | |
| 83 | def nolinesep(text): |
no test coverage detected