Remove whitespace

Co-authored-by: Ben Busby <noreply+git@benbusby.com>
This commit is contained in:
DUO Labs 2021-10-27 12:39:51 -04:00 committed by GitHub
parent 4e91a02a3e
commit 6891a8b295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'<b>\1</b>',