Skip to content
Snippets Groups Projects
Commit 2258b9a7 authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[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: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenjamin Kott <benjamin.kott@outlook.com>
Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarBenjamin Kott <benjamin.kott@outlook.com>
parent b412ad20
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment