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'])