Issue Bug Closed

#109452Form checkbox labels with RTE can render invalid HTML (<p> inside <label>)

Nicklas Tölke 04/01/26, 08:45 updated 04/21/26, 11:30

Description

Current Behavior

Since TYPO3 v14.2.0, checkbox labels in EXT:form support rich text editing.
This is useful for links like privacy-policy consent text.

However, the frontend checkbox template renders the label HTML directly inside the <label> element.
If the RTE content contains a paragraph, TYPO3 outputs <p> inside <label>, which is invalid HTML.

Expected Behavior

Checkbox labels should render valid HTML.

Either:
  • the form-label RTE processing should normalize content to inline-only markup for checkbox labels, or
  • the checkbox template should unwrap top-level paragraphs before rendering inside <label>.

Actual Behavior

Rendered markup can become:

<label for="..."><p>I agree to the <a href="/privacy">privacy policy</a>.</p></label>

Reviews 1

History 57

  1. Josua Vogel changed assigned to Josua Vogel 04/01/26, 09:00

  2. Josua Vogel commented 04/01/26, 09:12

    Hi @nicklas.toelke,
    Thank you very much for the bug report. I’ll look into the issue and try to find a solution. ;)

  3. Nicklas Tölke commented 04/01/26, 09:20

    Thanks for the quick response, @josuavogel :)
    Let me know if I can provide any additional details.

  4. Gerrit Code Review pushed patch set 1 for main to change 93509 status New Under Review 04/01/26, 10:23

  5. Gerrit Code Review pushed patch set 2 for main to change 93509 04/01/26, 16:14

  6. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % 04/02/26, 06:05

    Applied in changeset commit:1feed0cb0ef033e9bb478ba1c0a2080a87b324d8.

  7. Benni Mack changed status Resolved Closed 04/21/26, 11:30