on master help sign in
Replace every bunch of whitespaces with only one space in HTML text
commit52a57ee045e02844a8f650a9d3ae30e0092d86cd authorCqoicebordel <Cqoicebordel@users.noreply.github.com> dateFri 30 Jan 2015, 21:00 (12 years ago) parenta3d444a
1 file changed+2
searx/utils.py+2
searx/utils.py+2
@@ -119,6 +119,8 @@ class HTMLTextExtractor(HTMLParser):
119119
120120
121121def html_to_text(html):
122+ html = html.replace('\n', ' ')
123+ html = ' '.join(html.split())
122124 s = HTMLTextExtractor()
123125 s.feed(html)
124126 return s.get_text()