Use f-string in bold query regex

by @DUOLabs333
pull/496/head
Ben Busby 3 years ago
parent f154b5f2e2
commit 591ed4a6d6
No known key found for this signature in database
GPG Key ID: 339B7B7EB5333D14

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

Loading…
Cancel
Save