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 commented <span data-processor="relativetime" data-value="2026-04-01T09:12:01+00:00" > 04/01/26, 09:12 </span>

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

  2. Nicklas Tölke commented <span data-processor="relativetime" data-value="2026-04-01T09:20:59+00:00" > 04/01/26, 09:20 </span>

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

  3. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-04-02T06:05:09+00:00" > 04/02/26, 06:05 </span>

    Applied in changeset commit:1feed0cb0ef033e9bb478ba1c0a2080a87b324d8.