Review main Merged

85910[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
    • Benjamin Franzke +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Benjamin Franzke +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2836

Show 811 earlier messages
  1. Garvin Hicking uploaded patch set 1 09/06/24, 09:04

  2. core-ci voted on patch set 1 V +1 09/06/24, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64920

  3. Chris Müller commented on patch set 1 09/06/24, 12:30

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:26

    This has to be indented.

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:39

    beginning -> end

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:42

    they -> the
  4. Garvin Hicking uploaded patch set 2 V +1 09/09/24, 06:36

    wording changes
  5. core-ci voted on patch set 2 V +1 09/09/24, 06:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65058

  6. Garvin Hicking commented on patch set 2 09/09/24, 06:45

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:26 Reply

    Done

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:39 Reply

    Done

    Feature-104827-AllowCkEditorRegularExpressionObject.rst:42 Reply

    Done
  7. Chris Müller commented on patch set 2 09/09/24, 07:01

    Please also add the feature to the docs of this sysext.
  8. Garvin Hicking commented on patch set 2 09/09/24, 08:56

    Reply

    I'll wait with this until it's clear whether this feature is something that is useful.
  9. Garvin Hicking commented on patch set 2 CR -1 09/10/24, 08:42

    Going for another approach with Benjamin Franzke's feedback.
  10. Garvin Hicking uploaded patch set 3 CR -1 V +1 09/10/24, 10:26

    Rework patch
  11. core-ci voted on patch set 3 V +1 09/10/24, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65214

  1. Benjamin Franzke uploaded patch set 4 V +1 09/10/24, 18:18

  2. core-ci voted on patch set 4 V +1 09/10/24, 18:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65316

  3. Thomas Hohn voted on patch set 4 CR +1 09/13/24, 07:58

  4. Sebastian Iffland commented on patch set 4 CR +1 09/13/24, 08:02

    Default.yaml:12

    Wouldn't it be better to use one pattern all over? In the RST file and commit message `(tsconf|t3ts)$` applies, here differing. Just been curious.
  5. Garvin Hicking commented on patch set 4 09/13/24, 08:19

    Default.yaml:12 Reply

    I made it smaller for the changelog/commit msg to fit the rendered screen, which wasn't an issue for a larger yaml file. Since its just a dummy example, ideally I'd try to not reset votes for the change? 😇
  6. Sebastian Iffland commented on patch set 4 09/13/24, 08:25

    Default.yaml:12 Reply

    Acknowledged
  7. Guido Schmechel voted on patch set 4 CR +1 09/13/24, 10:57

  8. Stefan Bürk voted on patch set 4 CR +1 V +1 09/13/24, 21:05

  9. Garvin Hicking commented on patch set 4 CR -1 09/13/24, 21:09

    Default.yaml:13

    Wrong link, needs correction (Important, not festure). And move to 12.4 dir.
  10. Stefan Bürk commented on patch set 5 CR +1 V +1 09/13/24, 23:14

    Published edit on patch set 4.
  11. Stefan Bürk commented on patch set 6 09/13/24, 23:15

    Published edit on patch set 5.
  12. Stefan Bürk commented on patch set 6 CR +1 V +1 09/13/24, 23:15

    Default.yaml:13 Reply

    done - also in backport.
  13. core-ci voted on patch set 5 V +1 09/13/24, 23:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65717

  14. core-ci voted on patch set 6 V +1 09/13/24, 23:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65719

  15. Benjamin Franzke voted on patch set 6 CR +1 V +1 09/14/24, 03:17

  16. Garvin Hicking commented on patch set 6 09/14/24, 07:08

    Default.yaml:13 Reply

    I think this is missing "12.4" as directory, need to check
  17. Garvin Hicking uploaded patch set 7 CR +1 V +1 09/14/24, 07:40

    Adjust link in YAML
  18. Garvin Hicking commented on patch set 7 CR +1 V +1 09/14/24, 07:43

    Default.yaml:13 Reply

    Done
  19. core-ci voted on patch set 7 V -1 09/14/24, 07:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65742

  20. Garvin Hicking rebased onto patch set 8 CR +1 V +1 09/14/24, 10:02

  21. Anja Leichsenring voted on patch set 8 CR +1 V +1 09/14/24, 10:06

  22. core-ci voted on patch set 8 V +1 09/14/24, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65750

  23. Benjamin Franzke voted on patch set 8 CR +1 V +1 09/14/24, 16:29

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

  25. Garvin Hicking merged patch set 9 09/14/24, 17:41