diff --git a/app/utils/results.py b/app/utils/results.py index 61bde1c..c239a28 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -51,10 +51,10 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup: # the replacement if len(element) == len(target_word): return - + if not target_word.isalnum(): return - + element.replace_with( re.sub(fr'\b((?![{{}}<>-]){target_word}(?![{{}}<>-]))\b', r'\1',