Review main Merged

92861[BUGFIX] Allow capturing regexp replace in CKEditor 5

Garvin Hicking CR +2 V +2 Easy +3 −3 updated 02/17/26, 10:18

Commit message

With #104827 the support for regular expression replacements
in CKEditor 5 via `editor.config.typing.transformations` was
added.

This missed the possible scenario, where the target replacements
may contain capturing replacement groups with entries having
`null` as their values instead of strings.

For this, an exemption in the JavaScipt evaluation needs to be
made for these `null` types to not break the execution flow.

This now allows to use such a YAML configuration:

```
editor:
  config:
    typing:
      transformations:
        remove:
          - 'symbols'
          - 'quotes'
          - 'arrowLeft'
          - 'arrowRight'
        extra:
          - {from: {pattern: '(tsconf|t3ts)$', flags: ''}, to: 'TYPO3 TypoScript TSConfig'}
          - {from: {pattern: '(")([^"]*)(")$', flags: ''}, to: ['»', null, '«']}

```

(Note for this replacement group to work the "normal" quote conversion
mechanism first needs to be disabled)

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Benjamin Franzke +1
    • Simon Praetorius +1
    • Andreas Kienast +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Simon Praetorius +1
    • Daniel Siepmann +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 89

  1. Garvin Hicking uploaded patch set 1 02/17/26, 07:29

  2. Daniel Siepmann voted on patch set 1 V +1 02/17/26, 07:43

  3. Benjamin Franzke voted on patch set 1 CR +1 02/17/26, 07:59

  4. core-ci voted on patch set 1 V +1 02/17/26, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96013

  5. Oliver Hader voted on patch set 1 CR +1 02/17/26, 08:04

  6. Andreas Kienast voted on patch set 1 CR +1 02/17/26, 08:33

  7. Simon Praetorius voted on patch set 1 CR +1 V +1 02/17/26, 09:58

  8. Garvin Hicking voted on patch set 1 CR +2 V +2 02/17/26, 10:02

  9. Garvin Hicking merged patch set 2 02/17/26, 10:18