Issue Bug Closed

#109464f:render.text renders invalid HTML for richtext fields containing only a list

Nicklas Tölke 04/01/26, 14:19 updated 04/21/26, 11:30

Description

Summary

Rendering a richtext field with {f:render.text(…)} can produce invalid HTML
when the stored RTE content consists of a plain unordered list.

Environment

  • TYPO3: 14.2.0
  • PHP: 8.4
  • Theme: Camino

Steps to reproduce

  1. Create a regular text content element with RTE enabled
  2. Enter the following content in the RTE:
<ul>
    <li>Warm layers</li>
    <li>Passport or ID</li>
    <li>Reusable water bottle</li>
    <li>Small snacks for the road</li>
</ul>
  1. Render the field using:
{f:render.text(record: record, field: 'bodytext')}

Expected result

The frontend output should remain valid HTML:

<ul>
    <li>Warm layers</li>
    <li>Passport or ID</li>
    <li>Reusable water bottle</li>
    <li>Small snacks for the road</li>
</ul>

Actual result

The frontend output becomes invalid HTML:

<ul>
    <p>
        <li>Warm layers</li>
        <li>Passport or ID</li>
        <li>Reusable water bottle</li>
        <li>Small snacks for the road</li>
    </p>
</ul>

Additional notes

  • The HTML stored by the RTE is correct
  • The issue appears during frontend rendering
  • The problem seems to occur in the rendering chain:
    {f:render.text(…)} → {f:format.html(…)} → lib.parseFunc_RTE

Reviews 1

History 39

  1. Matthias Vogel commented <span data-processor="relativetime" data-value="2026-04-01T16:04:10+00:00" > 04/01/26, 16:04 </span>

    I investigated this issue and discovered that disabling the custom lib.parseFunc_RTE, the Problem disappears:

    https://github.com/TYPO3/typo3/blob/5b3c1c02b312209466aa3115dd50415cfbed3c4e/typo3/sysext/theme_camino/Configuration/Sets/camino/TypoScript/content.typoscript#L26-L47

    So we need to look into the parseFunc and why it creates a p inside the ul.

  2. Matthias Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-04-07T14:00:11+00:00" > 04/07/26, 14:00 </span>

    Applied in changeset commit:f12b9ecf90e8d352e70e2087d4be0ee885a5e01e.