From f59daa4a4b92ae3c6cbe2482a14f50810a15a644 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 12 Apr 2015 17:37:01 +0200 Subject: [PATCH] [fix] do not escape empty result content - closes #291 --- searx/webapp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 42d004e86..cbdff8962 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -365,11 +365,10 @@ def index(): result['title'] = highlight_content(result['title'], search.query.encode('utf-8')) else: - if 'content' in result: + if result.get('content'): result['content'] = html_to_text(result['content']).strip() # removing html content and whitespace duplications - result['title'] = ' '.join(html_to_text(result['title']) - .strip().split()) + result['title'] = ' '.join(html_to_text(result['title']).strip().split()) result['pretty_url'] = prettify_url(result['url'])