From 591ed4a6d610a47c771cf74d3e2de81d22b1c84a Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 26 Oct 2021 16:21:30 -0600 Subject: [PATCH] Use f-string in bold query regex by @DUOLabs333 --- app/utils/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/results.py b/app/utils/results.py index bb17051..0c04b76 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -53,7 +53,7 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup: return element.replace_with( - re.sub(r'\b((?![{}<>-])' + target_word + r'(?![{}<>-]))\b', + re.sub(fr'\b((?![{{}}<>-]){target_word}(?![{{}}<>-]))\b', r'\1', element, flags=re.I)