[BUGFIX] Allow to use CKEditor style definitions with an empty class
The CKEditor default YAML configuration for the Full and Default presets contained code like: ``` - { name: 'Orange title H2', element: 'h2', classes: [], styles: { color: 'orange', background: 'blue' } } - { name: 'Orange title H3', element: 'h3', classes: [], styles: { color: 'orange', background: 'blue' } } - { name: 'Quote / Citation', element: 'blockquote', classes: [], } - { name: 'Code block', element: 'code', classes: [], } - { name: 'Yellow marker', element: 'span', classes: [], styles: { background-color: 'yellow' } } ``` and ``` - { name: "Lead", element: "p", classes: ['lead'] } - { name: "Small", element: "small", classes: [] } - { name: "Muted", element: "span", classes: ['text-muted'] } ``` CKEditor 5 expects the "classes" attribute to contain an array of strings (or just a string) and not an empty array. Otherwise choosing such a style will have no effect in the CKEditor instance. The CKEditor5Migrator class has been enhanced to convert these empty or absent arrays to a `['']` definition on the fly. This allows integrators to continue using their hard-earned CKEditor YAML configurations without further change. The default YAML presets have been changed to omit the classes attribute, as that's what the intention of the configuration is. While this is a proprietary TYPO3 modification, we need this because of limited CKEditor5 functionality regarding classes handling. Also, the no longer valid "styles:" definitions have been removed. Resolves: #103979 Resolves: #103499 Releases: main, 12.4 Change-Id: Iad6f1a25c071ac70b51db2a3344b7c3bcd9f9687 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84679 Reviewed-by:Garvin Hicking <gh@faktor-e.de> Tested-by:
Benjamin Franzke <ben@bnf.dev> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benjamin Franzke <ben@bnf.dev>
Showing
- typo3/sysext/core/Classes/Configuration/CKEditor5Migrator.php 19 additions, 0 deletions...3/sysext/core/Classes/Configuration/CKEditor5Migrator.php
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-96874-CKEditor5.rst 4 additions, 2 deletions.../Documentation/Changelog/12.0/Feature-96874-CKEditor5.rst
- typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml 1 addition, 1 deletiontypo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml
- typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml 5 additions, 5 deletionstypo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml
Please register or sign in to comment