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

Style recognition fixes #1416

Merged
merged 2 commits into from
Oct 2, 2023
Merged

Conversation

Alspb
Copy link
Collaborator

@Alspb Alspb commented Oct 2, 2023

  1. Improves this fix, so that it works correctly for links and block styles.
    Editor input works in the following way:
    If the caret is just before some style, then text input doesn't share this style. For example, if the caret is before "b" in "bold", the input is not bold.
    If the caret is just after some style, then text input does share this style. For example, if the caret is after "d" in "bold", the input is bold. Links are the exceptions from this rule.
    The fix aligns style recognition with that approach.
    Block styles are also taken into account in the fix.

  2. Fixes [Mobile] or [Desktop] Bug in get selection style (controller.getSelectionStyle) #1404 and other selection style recognition issues.
    Before the fix range style was defined as symmetric difference of each individual segment's styles (at least for the case of two such segments in the range). That's why, for example, selecting "sometext" indicated it as an Italic (despite that the first part is Bold).
    Moreover, style values are also compared now. So, different colors or links in the range are not considered as having the same style.

@singerdmx singerdmx merged commit 84c2437 into singerdmx:master Oct 2, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

[Mobile] or [Desktop] Bug in get selection style (controller.getSelectionStyle)
2 participants