Fixed some other issues with the new regex system
This commit is contained in:
parent
fe8bfa655a
commit
e29552fd11
|
@ -53,7 +53,7 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup:
|
||||||
# Replace all instances of the word, but maintaining the same case in
|
# Replace all instances of the word, but maintaining the same case in
|
||||||
# the replacement
|
# the replacement
|
||||||
element.replace_with(
|
element.replace_with(
|
||||||
re.sub(fr"\b({target_word})\b",r"<b>\1</b>",element,flags=re.I)
|
re.sub(fr"\b[^-<>{{}}]({target_word})\b",r"<b> \1</b>",element,flags=re.I)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Split all words out of query, grouping the ones wrapped in quotes
|
# Split all words out of query, grouping the ones wrapped in quotes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user