[BUGFIX] Use CKEditor5 data model as source for link-browser
Do not operate on the view model, but always read link attributes from the data model. Do this to avoid conflicts with the (pre)view representation of the contents which may not represent the plain data 1:1. Examples: * CKEditor5 renderes phone links in the editor preview as `href="#"`. That means `href` must not be parsed from the link (#101303). * Link classes may be alterated with stateful style classes and had therefore be filtered server side previously (#101959). This is workaround could now be removed. To make it clear that the result of getSelectedLinkElement() must not be used as data source, the (more) correct return type `ViewAttributeElement` is defined now (upstream does so too). Note that CKEditor5 uses commands somewhat like data-models, where the data is to be collected in the refresh() method. This is why we process all link-related registered attribute in there, (based on the CKEditor5 schema). Releases: main, 12.4 Resolves: #101303 Related: #101959 Change-Id: I04ee9a07c7444cd197f70d658e856d6824254020 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81266 Tested-by:core-ci <typo3@b13.com> Tested-by:
Benjamin Kott <benjamin.kott@outlook.com> Tested-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by:
Benjamin Kott <benjamin.kott@outlook.com>
Showing
- Build/Sources/TypeScript/rte_ckeditor/plugin/typo3-link.ts 47 additions, 18 deletionsBuild/Sources/TypeScript/rte_ckeditor/plugin/typo3-link.ts
- typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php 1 addition, 4 deletions...rte_ckeditor/Classes/Controller/BrowseLinksController.php
- typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/plugin/typo3-link.js 1 addition, 1 deletion...ckeditor/Resources/Public/JavaScript/plugin/typo3-link.js
Please register or sign in to comment