Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(escape): make sure that __escaped does not get removed (#3830)
* fix(escape): make sure that __escaped does not get removed When mapping over an array, extra non-enumerable properties don't get copied into the new array. This means that the `__escaped` gets removed due to transformItems, or addAbsolutePosition. We fix this by setting that mark back just before calling the render function. We want transformItems to happen after escaping, so it's no option to put the mark before. Note also that if we would put the escaping before, we would still need to capture the marker, since it will be removed by the earlier transformations. The new tests I added fail without my modification. See also algolia/vue-instantsearch#639 which highlighted 😅 this issue. * Apply suggestions from code review Co-Authored-By: François Chalifour <francoischalifour@users.noreply.github.com> * chore: naming * test: remove unneeded mock * test: add comment
- Loading branch information
Showing
4 changed files
with
111 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters