0

I implemented react reader using this. Then I implemented highlighting text using this example.But I faced the following error: TypeError: contents.mark is not a function

Can anyone to help me fix it?

MSD
  • 49
  • 1
  • 6

1 Answers1

0

It looks like that example is pretty out of date. You're better off looking at the "highlights" example.

The mark() function actually lives on the annotations object, which is part of the rendition and not the content. mark, highlight and underline are all essentially the same thing, just styled a bit different.

You should be able to call rendition.annotations.mark(cfiRange).

sbatson5
  • 648
  • 11
  • 19