Draft: Fix selection when adding a link via shortcut
What does this MR do and why?
Previously, we linking a text which contained the word url
we would
preselect the first occurrence instead of the last.
Closes #207507.
For example:
Given the following text:
some fancy url
When selecting this text
>some fancy url<
And pressing CTRL+K
it would add a
link and preselect some fancy >url<
:
[some fancy >url<](url)
With this commit we preselect the last occurrence as expected:
[some fancy url](>url<)
Caught during !98505 (comment 1129846238)
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Open a note in an issue or MR
- Type
some fancy url
- Select the written word
- Press
CTRL+K
orCommand+K
- Verify preselected
url
word
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen