From 138f32471c5dfe12299471037782ac353462be74 Mon Sep 17 00:00:00 2001 From: Daniel Hones Date: Mon, 8 Feb 2021 23:58:54 -0500 Subject: Updated webutils.highlight_content to ignore double-quotes when highlighting query parts --- searx/webutils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'searx') diff --git a/searx/webutils.py b/searx/webutils.py index 8be8fcecd..2464a097f 100644 --- a/searx/webutils.py +++ b/searx/webutils.py @@ -119,7 +119,10 @@ def highlight_content(content, query): else: regex_parts = [] for chunk in query.split(): - if len(chunk) == 1: + chunk = chunk.replace('"', '') + if len(chunk) == 0: + continue + elif len(chunk) == 1: regex_parts.append('\\W+{0}\\W+'.format(re.escape(chunk))) else: regex_parts.append('{0}'.format(re.escape(chunk))) -- cgit v1.2.3