Commit a89df97
[BUGFIX] Prevent CKEditor link splitting on partial selection edit
When editing an existing link and selecting only part of the link
text (e.g., selecting "word" in "multi word link"), changing the link
target would split the link into multiple separate <a> elements.
This change automatically expands the selection to encompass the
entire link when:
- The user clicks the link button in the toolbar while positioned
inside or partially selecting a link
- The link browser is opened for an existing link
The expandSelectionToFullLink() method detects if the selection
is within a link and uses findAttributeRange() to expand it to
cover the complete link element before any modifications are made.
This prevents unwanted link fragmentation and ensures a consistent
editing experience.
Resolves: #108331
Releases: main, 13.4
Change-Id: Ida981a20db6171e975b057017ef9540f98f98318
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91897
Tested-by: Garvin Hicking <[email protected]>
Reviewed-by: Garvin Hicking <[email protected]>
Tested-by: core-ci <[email protected]>
Reviewed-by: Andreas Nedbal <[email protected]>
Tested-by: Andreas Nedbal <[email protected]>1 parent d218bf6 commit a89df97
File tree
2 files changed
+38
-2
lines changed- Build/Sources/TypeScript/rte-ckeditor/plugin
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/plugin
2 files changed
+38
-2
lines changedLines changed: 37 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
| 575 | + | |
575 | 576 | | |
576 | 577 | | |
577 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
578 | 582 | | |
579 | 583 | | |
580 | 584 | | |
| |||
736 | 740 | | |
737 | 741 | | |
738 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
739 | 773 | | |
740 | 774 | | |
741 | 775 | | |
742 | 776 | | |
| 777 | + | |
743 | 778 | | |
| 779 | + | |
744 | 780 | | |
745 | 781 | | |
746 | 782 | | |
| |||
0 commit comments