Skip to content

Commit

Permalink
change regex on highlight_terms
Browse files Browse the repository at this point in the history
  • Loading branch information
edulauer committed Apr 17, 2024
1 parent d32432d commit ae3bfdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/inlabs_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def _highlight_terms(terms: list, text: str) -> str:
"""

escaped_terms = [re.escape(term) for term in terms]
pattern = rf"\b({'|'.join(escaped_terms)})\b"
pattern = f"({'|'.join(escaped_terms)})"
highlighted_text = re.sub(
pattern, r"<%%>\1</%%>", text, flags=re.IGNORECASE
)
Expand Down

0 comments on commit ae3bfdf

Please sign in to comment.