Add check for style tags
Co-authored-by: Ben Busby <noreply+git@benbusby.com>
This commit is contained in:
parent
d5f5645e2c
commit
21501be1c5
|
@ -52,7 +52,8 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup:
|
|||
if len(element) == len(target_word):
|
||||
return
|
||||
|
||||
if not re.match('.*[a-zA-Z0-9].*', target_word):
|
||||
if not re.match('.*[a-zA-Z0-9].*', target_word) or (
|
||||
element.parent and element.parent.name == 'style'):
|
||||
return
|
||||
|
||||
element.replace_with(
|
||||
|
|
Loading…
Reference in New Issue
Block a user