summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-02-04 19:42:32 +0100
committerasciimoo <asciimoo@gmail.com>2014-02-04 19:42:32 +0100
commit5695ec58df14615e154072e97afc4bd6ed505812 (patch)
tree2b92dfd7f951be6029f31e9237ed9d53c7dc090e /searx/webapp.py
parent474f6a861d1be5a874deefd5d60dd45b40db0a03 (diff)
[fix] whitespace duplication fix in nonhtml outputs
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index ec8fe8fb3..c52fae9d9 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -190,7 +190,9 @@ def index():
else:
if 'content' in result:
result['content'] = html_to_text(result['content']).strip()
- result['title'] = html_to_text(result['title']).strip()
+ # removing html content and whitespace duplications
+ result['title'] = ' '.join(html_to_text(result['title'])\
+ .strip().split())
if len(result['url']) > 74:
url_parts = result['url'][:35], result['url'][-35:]
result['pretty_url'] = '{0}[...]{1}'.format(*url_parts)