Closed sokach-dev closed 1 year ago
Implement this API in the EPUBNavigatorDelegate
: https://github.com/readium/swift-toolkit/blob/9e0339787aa69f96bb16335f55a858d626eaccb9/Sources/Navigator/SelectableNavigator.swift#L38
Then look at the text context in selection.locator.text
. The before
and after
properties should contain more text context around the current selected word.
If this doesn't work, you will need to implement your own JavaScript to do that:
When I press and select a word, can I get the sentence of the word? How should I call the function if I can?
Examples: Today is a wonderful day!
When I press "wonderful", I also get "Today is a wonderful day!"