SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] central html escaping of results
Adam Tauberef2ef7974ab9
diff --git a/searx/webapp.py b/searx/webapp.pyindex 8996aa2b9..352a49fb6 100644--- a/searx/webapp.py+++ b/searx/webapp.py@@ -40,7 +40,7 @@ except:logger.critical("cannot import dependency: pygments")from sys import exitexit(1)-+from cgi import escapefrom datetime import datetime, timedeltafrom urllib import urlencodefrom urlparse import urlparse, urljoin@@ -433,8 +433,9 @@ def index():for result in results:if output_format == 'html':if 'content' in result and result['content']:- result['content'] = highlight_content(result['content'][:1024], search_query.query.encode('utf-8'))- result['title'] = highlight_content(result['title'], search_query.query.encode('utf-8'))+ result['content'] = highlight_content(escape(result['content'][:1024]),+ search_query.query.encode('utf-8'))+ result['title'] = highlight_content(escape(result['title']), search_query.query.encode('utf-8'))else:if result.get('content'):result['content'] = html_to_text(result['content']).strip()