mirror of
https://github.com/searxng/searxng.git
synced 2024-12-29 20:50:28 +00:00
[fix] whitespace duplication fix in nonhtml outputs
This commit is contained in:
parent
474f6a861d
commit
5695ec58df
1 changed files with 3 additions and 1 deletions
|
@ -190,7 +190,9 @@ def index():
|
||||||
else:
|
else:
|
||||||
if 'content' in result:
|
if 'content' in result:
|
||||||
result['content'] = html_to_text(result['content']).strip()
|
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:
|
if len(result['url']) > 74:
|
||||||
url_parts = result['url'][:35], result['url'][-35:]
|
url_parts = result['url'][:35], result['url'][-35:]
|
||||||
result['pretty_url'] = '{0}[...]{1}'.format(*url_parts)
|
result['pretty_url'] = '{0}[...]{1}'.format(*url_parts)
|
||||||
|
|
Loading…
Reference in a new issue