Use f-string in bold query regex

by @DUOLabs333
main
Ben Busby 2021-10-26 16:21:30 -06:00
parent f154b5f2e2
commit 591ed4a6d6
No known key found for this signature in database
GPG Key ID: 339B7B7EB5333D14
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup:
return return
element.replace_with( element.replace_with(
re.sub(r'\b((?![{}<>-])' + target_word + r'(?![{}<>-]))\b', re.sub(fr'\b((?![{{}}<>-]){target_word}(?![{{}}<>-]))\b',
r'<b>\1</b>', r'<b>\1</b>',
element, element,
flags=re.I) flags=re.I)