epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Check if range is Highlighted

Open erickbank opened this issue 7 years ago • 2 comments
trafficstars

How to avoid highlighting the same range? , even in the example if you select the text that is already highlighted it will highlight again.

erickbank avatar Oct 19 '18 14:10 erickbank

Any update?

eshaw29 avatar Dec 10 '19 07:12 eshaw29

How to avoid highlighting the same range? , even in the example if you select the text that is already highlighted it will highlight again.

I managed to do this with browser local storage. Store the highlighted ranges in local storage as array of string. Every time new highlight is done, compare the highlight cfi with local storage string array. If the array does not have the entry then highlight and update the local storage string array.

nikhilbhalwankar avatar Jul 13 '21 17:07 nikhilbhalwankar