-
Hello, please help! I'm facing an issue with the following bit of code: <Configure highlightPreTag='<em>' highlightPostTag='</em>' /> This requires one of these configurations: <Hits escapeHTML={false} /> useHits({ ...props, escapeHTML: false }) Without Further down the call stack, React does its usual thing: escaping strings containing HTML! To render the highlight tags properly, I also do the usual This workflow feels cumbersome and unintuitive. There must be a better way to avoid this. Am I approaching this wrong? Any guidance would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
In the |
Beta Was this translation helpful? Give feedback.
-
I see you can pass that in now: <Highlight highlightedTagName='em' attribute='title' hit={hit} /> But I think this may not work because:
It looks like the util always gets its tag replacement from the constant TAG_REPLACEMENT. |
Beta Was this translation helpful? Give feedback.
-
I was making this so complicated. It couldn't have been easier! Thank you sir. |
Beta Was this translation helpful? Give feedback.
yes, I may not have been clear but when you pass highlightedTagName, you don't change the tags in configure, and you'll end up with the tags you want in the dom