How to escape HTML in highlight (vanilla JS implementation)? #1131
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hey @thecristen, this should normally work (see example), so I'm suspecting a version issue. Can you share a CodeSandbox reproduction so I can see what's wrong? |
Beta Was this translation helpful? Give feedback.
-
Are you sending a manual highlightPreTag and highlightPostTag to |
Beta Was this translation helpful? Give feedback.
-
I'll work on the reproducible example, just wanted to answer that I'm not using |
Beta Was this translation helpful? Give feedback.
-
Ahh I think @Haroenv had the best clue. I'm using my backend to query Algolia via the REST API ( Is this use case (bespoke fetches of the Algolia REST API) not supported when using the built-in |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure there's also user (my) error going into this though. Here's an example sandbox showing code that I would expect to display bolded matched text, that doesn't. |
Beta Was this translation helpful? Give feedback.
You’ll need to make sure you’re sending all the same parameters to Algolia in your backend as getAlgoliaResults would. For highlight to work as expected that’s highlightPreTag/PostTag the same values as used (
__aa-highlight__
/__/aa-highlight
).I’d recommend you use the built-in functions though, there’s a lot of differences between fetching done by the api client and getAlgiliaResults (caching, deduplication, retry strategy and SLA to name just some)