Review 12.4 Merged

85766[BUGFIX] Allow to use CKEditor style definitions with an empty class

Garvin Hicking CR +2 V +2 Easy +29 −8 updated 08/29/24, 10:06

Commit message

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.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2

Issues 2

Files 4

Review log 34

  1. Garvin Hicking commented on patch set 1 08/29/24, 09:57

    Cherry Picked from branch main.
  2. Garvin Hicking voted on patch set 1 CR +2 V +2 08/29/24, 09:58

  3. Garvin Hicking merged patch set 2 08/29/24, 09:58

  4. core-ci voted on patch set 1 V +1 08/29/24, 10:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64464