Change "skip bolding" check to regex to fix some edge cases
This commit is contained in:
parent
190b684469
commit
d5f5645e2c
|
@ -52,7 +52,7 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup:
|
||||||
if len(element) == len(target_word):
|
if len(element) == len(target_word):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not target_word.isalnum():
|
if not re.match('.*[a-zA-Z0-9].*', target_word):
|
||||||
return
|
return
|
||||||
|
|
||||||
element.replace_with(
|
element.replace_with(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user