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.
Suggested merge commit message (convention)
Fix (html-support): The
DocumentSelection
should not store the GHSlinkA
attribute if thelinkHref
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 theDocumentSelection
andSelection
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 asinput
) 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 thetargetRanges
instead of theDocumentSelection
. TheSelection
provided for the command was not related to theDocumentSelection
and selection attributes behaved differently depending on whether theDocumentSelection
orSelection
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.
insertText
command receives the selection to override the content).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.