[fix] do not escape empty result content - closes #291

This commit is contained in:
Adam Tauber 2015-04-12 17:37:01 +02:00
parent b2e026dde2
commit f59daa4a4b

View file

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