mirror of https://github.com/searx/searx
[fix] title escaping
This commit is contained in:
parent
0eb3cdf664
commit
fa6f430f2e
|
@ -19,7 +19,7 @@ def response(resp):
|
||||||
for result in dom.xpath('//div[@class="question-summary search-result"]'):
|
for result in dom.xpath('//div[@class="question-summary search-result"]'):
|
||||||
link = result.xpath('.//div[@class="result-link"]//a')[0]
|
link = result.xpath('.//div[@class="result-link"]//a')[0]
|
||||||
href = urljoin(url, link.attrib.get('href'))
|
href = urljoin(url, link.attrib.get('href'))
|
||||||
title = ' '.join(link.xpath('.//text()'))
|
title = escape(' '.join(link.xpath('.//text()')))
|
||||||
content = escape(' '.join(result.xpath('.//div[@class="excerpt"]//text()')))
|
content = escape(' '.join(result.xpath('.//div[@class="excerpt"]//text()')))
|
||||||
results.append({'url': href, 'title': title, 'content': content})
|
results.append({'url': href, 'title': title, 'content': content})
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in New Issue