futurepress / epub.js

Enhanced eBooks in the browser.
http://futurepress.org
Other
6.4k stars 1.1k forks source link

RangeObject.toString() returns undefined #798

Open Dalamar opened 6 years ago

Dalamar commented 6 years ago

Hi! There are few discussions on how to get text value from RangeObject, for instance for highlighted text using range.toString() See: https://github.com/futurepress/epub.js/issues/777 But I can't get how come that those guys managed to get text if you haven't yet implemented this method:

https://github.com/futurepress/epub.js/blob/2df8eefd3b80eec92d9a6cabfd8b441518a6f84a/src/utils/core.js#L840

What is the ETA for this feature?

P.S. I wish I could help you with that but I've just started learning epubjs.

fchasen commented 6 years ago

What browser are you using? The RangeObject is just a very small polyfill for Range, which is pretty well supported cross browser at this point.

I think https://github.com/timdown/rangy would likely have a good example of how this method could be implemented.

Dalamar commented 6 years ago

I use Epub.js React Native Components which renders book in a WebView which renders web content in a native view (WKWebView in iOS for instance).