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

2-SCM fixes #15373

Merged
merged 11 commits into from
Nov 22, 2023
Merged

2-SCM fixes #15373

merged 11 commits into from
Nov 22, 2023

Conversation

niegowski
Copy link
Contributor

@niegowski niegowski commented Nov 18, 2023

Suggested merge commit message (convention)

Fix (html-support): The DocumentSelection should not store the GHS linkA attribute if the linkHref attribute was removed by the two-step caret movement feature. Closes #15051.

Other (link, typing): The logic behind the two-step caret movement extracted to the common code in the two-step caret movement feature.

Other (typing): Unified behavior of the insertText command for cases using the DocumentSelection and Selection as applied attributes behaved differently in those cases.


Additional information

The behavior of typing over the fully-selected formatted text content (for example foo <b>[bar]</b> baz) was changing over time.

Initially the insertText (previously known as input) command inserted text without a bold attribute (if the formatted part was fully selected before typing).

After migration to the beforeInput events, this behavior changed as a side effect of using the targetRanges instead of the DocumentSelection. The Selection provided for the command was not related to the DocumentSelection and selection attributes behaved differently depending on whether the DocumentSelection or Selection was provided to the command.

In this PR I fixed the case of mixed behavior. I decided to keep the current behavior for two reasons.

  • First, it is how it works now (the insertText command receives the selection to override the content).
  • Second, in the LinkEditing we had a custom logic to be able to type over a link and replace the text label of the link without removing the link itself. It looks reasonable to me.

@niegowski niegowski changed the title Ck/15051 2-SCM fixes Nov 18, 2023
@niegowski niegowski marked this pull request as ready for review November 20, 2023 17:33
@niegowski niegowski requested a review from arkflpc November 20, 2023 17:40
@arkflpc arkflpc merged commit 73c2985 into master Nov 22, 2023
@arkflpc arkflpc deleted the ck/15051 branch November 22, 2023 08:01
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.

Links with class attributes can create unexpected duplicate elements in regular editing
2 participants