Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'nodeType' of null #31

Open
Praveen-Danagoudra opened this issue Apr 10, 2017 · 1 comment
Open

Cannot read property 'nodeType' of null #31

Praveen-Danagoudra opened this issue Apr 10, 2017 · 1 comment

Comments

@Praveen-Danagoudra
Copy link

/**
* Highlights range.
* Wraps text of given range object in wrapper element.
* @param {Range} range
* @param {HTMLElement} wrapper
* @returns {Array} - array of created highlights.
* @memberof TextHighlighter
*/
TextHighlighter.prototype.highlightRangefunction(range, wrapper) {
....

  • here if result.startContainer is undefined then we are getting "Cannot read property 'nodeType' of null" error.
@corinnaSchultz
Copy link

I modified src/text-highlighter.js to add the following if statement to refineRangeBoundaries:

   } else if (startContainer.nextSibling) {
      startContainer = startContainer.nextSibling;
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants