Add check for style tags

Co-authored-by: Ben Busby <noreply+git@benbusby.com>
This commit is contained in:
DUO Labs 2021-10-28 14:51:43 -04:00 committed by GitHub
parent d5f5645e2c
commit 21501be1c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,8 @@ 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 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 return
element.replace_with( element.replace_with(