mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[enh] central handling of empty result titles
This commit is contained in:
parent
72a217f983
commit
d80fb2c8e8
1 changed files with 2 additions and 1 deletions
|
@ -435,7 +435,8 @@ def index():
|
||||||
if 'content' in result and result['content']:
|
if 'content' in result and result['content']:
|
||||||
result['content'] = highlight_content(escape(result['content'][:1024]),
|
result['content'] = highlight_content(escape(result['content'][:1024]),
|
||||||
search_query.query.encode('utf-8'))
|
search_query.query.encode('utf-8'))
|
||||||
result['title'] = highlight_content(escape(result['title']), search_query.query.encode('utf-8'))
|
result['title'] = highlight_content(escape(result['title'] or u''),
|
||||||
|
search_query.query.encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
if result.get('content'):
|
if result.get('content'):
|
||||||
result['content'] = html_to_text(result['content']).strip()
|
result['content'] = html_to_text(result['content']).strip()
|
||||||
|
|
Loading…
Add table
Reference in a new issue