mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Text highlighting: extend to include punctuations
When selected text seems to be a "sentence segment" (that is, when there are punctuations around start AND end), extend the selection to include the relevant punctuation. Do this only when saving highlights and for translation (but not when dict or wikipedia lookups, or search).
This commit is contained in:
@@ -835,6 +835,10 @@ function CreDocument:getTextFromXPointers(pos0, pos1, draw_selection)
|
||||
return self._document:getTextFromXPointers(pos0, pos1, draw_selection, draw_segmented_selection)
|
||||
end
|
||||
|
||||
function CreDocument:extendXPointersToSentenceSegment(pos0, pos1)
|
||||
return self._document:extendXPointersToSentenceSegment(pos0, pos1)
|
||||
end
|
||||
|
||||
function CreDocument:getHTMLFromXPointer(xp, flags, from_final_parent)
|
||||
if xp then
|
||||
return self._document:getHTMLFromXPointer(xp, flags, from_final_parent)
|
||||
|
||||
Reference in New Issue
Block a user