Remove whitespace
Co-authored-by: Ben Busby <noreply+git@benbusby.com>
This commit is contained in:
parent
4e91a02a3e
commit
6891a8b295
|
@ -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>',
|
||||
|
|
Loading…
Reference in New Issue
Block a user