on master help sign in
Replace every bunch of whitespaces with only one space in HTML text
52a57eeCqoicebordel
searx/utils.py+2
@@ -119,6 +119,8 @@ class HTMLTextExtractor(HTMLParser):
119
119
120
120
121def html_to_text(html):
121def html_to_text(html):
122+ html = html.replace('\n', ' ')
123+ html = ' '.join(html.split())
122 s = HTMLTextExtractor()
124 s = HTMLTextExtractor()
123 s.feed(html)
125 s.feed(html)
124 return s.get_text()
126 return s.get_text()