Review 12.4 Merged

86054[TASK] Enhance Regular Expression parsing for CKEditor YAML config

Garvin Hicking CR +2 V +2 Normal +120 −2 updated 09/14/24, 17:41

Commit message

The CKEditor v5 configuration API allows to specify
Regular Expression JavaScript objects, for example in
:javascript:`editor.config.typing.transformations.extra.from` or
:javascript:`editor.config.htmlSupport.allow.name`:

When TYPO3 passes YAML configuration of the CKEditor forward
to JavaScript, it uses a html-entity encoded representation,
which does not allow to utilize Regular Expression objects,
and also the CKEditor API method `buildQuotesRegExp()` is not
usable in this scenario.

This was remedied already for the configuration key :yaml:`htmlSupport`
with its sub-keys, so that when a YAML key named :yaml:`pattern`
was found, TYPO3 automatically converted that to a proper JavaScript
Regular Expression.

This is now also possible for the `editor.config.typing.transformations`
structure:

```
editor:
  config:
    typing:
      transformations:
        extra:
          - { from: { pattern: '(tsconf|t3ts)$'},
              to: 'TYPO3 TypoScript TSConfig' }
```

From searching the CKEditor v5 documentation it seems there
are no other usages where Regular Expressions are used,
but this is not easily revealed. Future places can be added
easily.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 58

  1. Garvin Hicking commented on patch set 1 09/13/24, 21:06

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 09/13/24, 21:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65710

  3. Stefan Bürk commented on patch set 2 V +1 09/13/24, 23:15

    Published edit on patch set 1.
  4. core-ci voted on patch set 2 V +1 09/13/24, 23:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65718

  5. Garvin Hicking uploaded patch set 3 V +1 09/14/24, 07:43

    Adjust link
  6. core-ci voted on patch set 3 V +1 09/14/24, 07:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65743

  7. Garvin Hicking voted on patch set 3 CR +2 V +2 09/14/24, 17:41

  8. Garvin Hicking merged patch set 4 09/14/24, 17:41