-
Notifications
You must be signed in to change notification settings - Fork 157
fix(highlight): change expected tag to replace #679
Conversation
I checked it, and this change also fixes it for searchable |
The stories don't seem to work, they display |
That’s because of InstantSearch’s PR not yet been used here (there’s two hits widgets). You can check a story with only one hits to see it working compared to previously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that InstantSearch 3.x.x is available we should be able to use highlight
& snippet
that are available on the default export. We don't have to duplicate the logic to perform this operation.
innerHTML() {
return instantsearch.highlight({
attribute: this.attribute,
hit: this.hit,
highlightedTagName: this.highlightedTagName,
});
},
That’ll only work with escapeHTML: false, which is why I didn’t go for it |
You're sure? I've tested it without issues. We use the same strategy inside InstantSearch.js. |
It's possible that it works, but in the end it would be best if we migrate the InstantSearch highlight strategy to the one of React InstantSearch where there's no need for escaping or innerHTML, but you can map over the parts |
highlighted-tag-name still does not work for me. Is the above fix tagged? I'm on "vue-instantsearch": "^2.2.1" |
@benjam-es The issue is fully fixed since #691 which updates the InstantSearch.js dependency. Vue InstantSearch wasn't released since. The |
…arch#679) * fix(highlight): change expected tag to replace * chore: remove comment * Apply suggestions from code review * fix: update tests * chore: inline variables
fixes #639
to fully fix #639, we also want algolia/instantsearch#3830 to be merged, however those are completely separate issues