parent
431e0f2b48
commit
8c3e92aa31
1 changed files with 2 additions and 2 deletions
|
|
@ -260,9 +260,9 @@ class CleanText(Filter):
|
|||
txt = [t.strip() for t in txt.itertext()]
|
||||
else:
|
||||
txt = [txt.text.strip()]
|
||||
txt = u' '.join(txt) # 'foo bar'
|
||||
txt = u' '.join(txt) # 'foo bar'
|
||||
if newlines:
|
||||
txt = re.sub(u'\s+', u' ', txt, flags=re.UNICODE) # 'foo bar'
|
||||
txt = re.compile(u'\s+', flags=re.UNICODE).sub(u' ', txt) # 'foo bar'
|
||||
else:
|
||||
# normalize newlines and clean what is inside
|
||||
txt = '\n'.join([cls.clean(l) for l in txt.splitlines()])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue