Review main Merged

93995[BUGFIX] Allow limited markup in form inspector labels and descriptions

Josua Vogel CR +2 V +2 Normal +63 −41 updated 07/28/26, 06:23

Commit message

Inspector editor labels and descriptions defined in YAML form configurations
were always rendered as plain text due to the use of document.createTextNode()
and .textContent assignments.
This prevented integrators from using basic HTML markup such as <br>
for line breaks or <strong> for emphasis in their configurations.

Two new private helper methods and configs are introduced in
the inspector component, which sanitize provided HTML via DOMPurify
before assigning it as innerHTML.
The label config allows only phrasing content, while the description
config allows some more tags, e.g. lists.

DOMPurify is an existing TYPO3 Core dependency.

Review

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

Issues 1

Files 2

Review log 2841

Show 1116 earlier messages
  1. Josua Vogel uploaded patch set 1 05/05/26, 16:32

  2. Josua Vogel updated the commit message in patch set 2 05/05/26, 16:33

  3. core-ci voted on patch set 1 V +1 05/05/26, 16:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101569

  4. core-ci voted on patch set 2 V -1 05/05/26, 16:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101570

  5. core-ci voted on patch set 2 V +1 05/05/26, 16:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101570

  6. Garvin Hicking commented on patch set 2 05/05/26, 21:41

    inspector-component.ts:170

    Our markdown implementation has this: ``` ALLOWED_TAGS: ['a', 'blockquote', 'br', 'code', 'kbd', 'li', 'p', 'pre', 'strong', 'ul', 'ol'], ALLOWED_ATTR: ['href', 'target', 'title', 'role'], ``` So maybe also allow "role" as attr, and "blockquote" as well as "kbd" as tags?
  7. Josua Vogel uploaded patch set 3 V +1 05/06/26, 11:45

  8. Josua Vogel commented on patch set 3 05/06/26, 11:45

    inspector-component.ts:170 Reply

    Done
  9. core-ci voted on patch set 3 V +1 05/06/26, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101614

  10. Garvin Hicking commented on patch set 3 05/06/26, 15:47

    inspector-component.ts:170 Reply

    Maybe we can get some feedback if its clever to allow editors to insert p/li there, that could probably break the layout a lot?
  11. wini2 wini2 voted on patch set 3 V +1 05/06/26, 22:32

  12. Josua Vogel commented on patch set 3 05/07/26, 06:24

    inspector-component.ts:170 Reply

    No, the layout doesn´t break. But I realized, that p, ol ,... aren´t allowed inside label elements. I will split the config.
  13. Josua Vogel uploaded patch set 4 V +1 05/07/26, 06:31

  14. core-ci voted on patch set 4 V +1 05/07/26, 06:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101650

  15. Josua Vogel uploaded patch set 5 V +1 05/07/26, 07:07

  16. Mathias Brodala commented on patch set 4 05/07/26, 07:13

    inspector-component.ts:163

    IMO "a" should not be allowed inside labels. While this kind of works in many browsers it is an a11y issue since labels are triggers for interacting with fields: https://melsumner.github.io/links-labels So this should be removed alongside with the "target" attribute below.
  1. core-ci voted on patch set 5 V +1 05/07/26, 07:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101655

  2. Josua Vogel commented on patch set 5 05/07/26, 07:32

    inspector-component.ts:163 Reply

    Good point. Thx! If we remove a, then rel and href could be removed too.
  3. Helmut Hummel commented on patch set 5 05/07/26, 10:17

    inspector-component.ts:163 Reply

    if allowing <a href> would also allow <a href="javascript:alert(123)"> I would remove it anyway (even if by default there CSPs are active by default).
  4. Josua Vogel commented on patch set 5 05/07/26, 11:12

    inspector-component.ts:163 Reply

    No, javascript:alert(123) would be removed by the sanitizer
  5. Josua Vogel commented on patch set 5 05/07/26, 11:13

    inspector-component.ts:170 Reply

    Done
  6. Josua Vogel uploaded patch set 6 V +1 05/07/26, 11:17

  7. Mathias Brodala commented on patch set 6 05/07/26, 11:18

    inspector-component.ts:163 Reply

    Done
  8. core-ci voted on patch set 6 V +1 05/07/26, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101676

  9. Josua Vogel rebased onto patch set 7 V +1 05/22/26, 12:08

  10. core-ci voted on patch set 7 V +1 05/22/26, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102353

  11. Josua Vogel rebased onto patch set 8 V +1 06/01/26, 14:12

  12. core-ci voted on patch set 8 V +1 06/01/26, 14:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102765

  13. Josua Vogel rebased onto patch set 9 V +1 06/24/26, 20:59

  14. core-ci voted on patch set 9 V +1 06/24/26, 21:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103835

  15. Josua Vogel rebased onto patch set 10 V +1 07/03/26, 17:02

  16. core-ci voted on patch set 10 V +1 07/03/26, 17:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104321

  17. Josua Vogel rebased onto patch set 11 V +1 07/17/26, 15:07

  18. core-ci voted on patch set 11 V +1 07/17/26, 15:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104894

  19. Garvin Hicking voted on patch set 11 CR +1 V +1 07/24/26, 15:22

  20. Josua Vogel uploaded patch set 12 CR +1 V +1 07/26/26, 12:25

  21. core-ci voted on patch set 12 V +1 07/26/26, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105419

  22. Garvin Hicking voted on patch set 12 CR +1 V +1 07/26/26, 12:51

  23. Benni Mack voted on patch set 12 CR +1 V +1 07/28/26, 06:21

  24. Benni Mack voted on patch set 12 CR +2 V +2 07/28/26, 06:23

  25. Benni Mack merged patch set 13 07/28/26, 06:23