-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix autolinking with highlighted search results
The current logic assumes that all spans in the text layer contain only one text node, and thus that the position information returned by `highlighter._convertMatches` can be directly used on the element's only child. This is not true in case of highlighted search results: they will be injected in the DOM as `<span>` elements, causing the `<span>`s in the text layer to have more than one child. This patch fixes the problem by properly converting the (span, offset) pair in a (textNode, offset) pair that points to the right text node.
- Loading branch information
1 parent
50c573d
commit b47d815
Showing
2 changed files
with
127 additions
and
4 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