Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.