1
0
mirror of https://github.com/jfilter/clean-text.git synced 2021-09-19 22:32:58 +03:00
This commit is contained in:
Johannes Filter
2019-04-24 22:17:29 +02:00
parent 1054e8d039
commit d3db78bd9a

View File

@@ -86,7 +86,7 @@ def to_ascii_unicode(text, lang="en"):
def normalize_whitespace(text, no_line_breaks=False):
"""
Given ``text`` str, replace one or more spacings with a single space, and one
or more linebreaks with a single newline. Also strip leading/trailing whitespace.
or more line breaks with a single newline. Also strip leading/trailing whitespace.
"""
if no_line_breaks:
text = constants.MULTI_WHITESPACE_TO_ONE_REGEX.sub(" ", text)