Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting problem in Chinese ebook related with punctuation #9219

Open
idevsoft opened this issue Jun 16, 2022 · 4 comments
Open

Highlighting problem in Chinese ebook related with punctuation #9219

idevsoft opened this issue Jun 16, 2022 · 4 comments

Comments

@idevsoft
Copy link

  • KOReader version: 2022.05.01
  • Device: Ubuntu 20.04、Android 11

Issue

When highlighting text, the last punctuation mark cannot be selected. If selected, the first word after the punctuation mark will be selected also. Appears in Chinese books, English books do not have this problem.

Steps to reproduce

Highlighting Chinese ebook paragraph.

@idevsoft
Copy link
Author

Then I want to reproduce this problem under version 2022.03.01, but it is OK.

@poire-z
Copy link
Contributor

poire-z commented Jun 16, 2022

See #6217, #6268, #6473, #8857, #9169, #9198.
Should be better in current nightlies or in coming soon v2022.06.

We only include words, non-punctuation, when you do the text selection.
You can then tap on the highlight made to have a popup to extend it, and when long-press on the arrows, you can extend by char, so including punctuation.
With this recent fix, we include punctuation when what you have selected looks like a whole sentence.

Please check the recent fix is also OK with Chinese and tell us.

@idevsoft
Copy link
Author

idevsoft commented Jul 8, 2022

Check this using v2022.06. Chinese text selection becomes weird. I don't need the punctuation, but selected automatically. I want it, but the next character is selected also. I think the intelligent selection should can be disabled, the punctuation can be treated like a normal character. Rollback to v2022.03.01.
Thanks.

@poire-z
Copy link
Contributor

poire-z commented Jul 8, 2022

You wanted it in the first post, you don't want it in your last post :)
So, I guess it depends on circunstances: we try to do the right thing - if it is not the right thing, you fix the highlight in a 2nd manual step.

the punctuation can be treated like a normal character

Nope, punctuation is not candidate when you make the text selection: this is quite involved in the code, and we won't change that. It's also what most people expect (and I don't see why it would be different with Chinese). When you want to include it or remove it, you tap on the highlight just made and you fix it with long-press on the arrows.

I think the intelligent selection should can be disabled

Not until we get some other feedback about this.
But you can disable it on your side with a user patch.
Create the directory koreader/patches/ and in it a file koreader/patches/2-no-extend-to-include-punctuation.lua with this content:

local CreDocument = require("document/credocument")
CreDocument.extendXPointersToSentenceSegment = function() return end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants