forked from Icycoide/searxng
Merge branch 'unit-tests' of https://github.com/Cqoicebordel/searx into Cqoicebordel-unit-tests
Conflicts: searx/tests/test_engines.py
This commit is contained in:
commit
7f865356f9
45 changed files with 3692 additions and 71 deletions
|
@ -115,10 +115,12 @@ class HTMLTextExtractor(HTMLParser):
|
|||
self.result.append(name)
|
||||
|
||||
def get_text(self):
|
||||
return u''.join(self.result)
|
||||
return u''.join(self.result).strip()
|
||||
|
||||
|
||||
def html_to_text(html):
|
||||
html = html.replace('\n', ' ')
|
||||
html = ' '.join(html.split())
|
||||
s = HTMLTextExtractor()
|
||||
s.feed(html)
|
||||
return s.get_text()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue