From 21501be1c50e252ef509ac228f5fdfe2fd9674af Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Thu, 28 Oct 2021 14:51:43 -0400 Subject: [PATCH] Add check for style tags Co-authored-by: Ben Busby --- app/utils/results.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/results.py b/app/utils/results.py index c2fb38e..7b603fb 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -52,7 +52,8 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup: if len(element) == len(target_word): return - if not re.match('.*[a-zA-Z0-9].*', target_word): + if not re.match('.*[a-zA-Z0-9].*', target_word) or ( + element.parent and element.parent.name == 'style'): return element.replace_with(