#109464f:render.text renders invalid HTML for richtext fields containing only a list
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
- Create a regular text content element with RTE enabled
- 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>
- 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
-
Matthias Vogel commented <span data-processor="relativetime" data-value="2026-04-01T16:04:10+00:00" > 04/01/26, 16:04 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 93523 status
NewUnder Review <span data-processor="relativetime" data-value="2026-04-02T11:40:38+00:00" > 04/02/26, 11:40 </span> -
Gerrit Code Review pushed patch set 2 for main to change 93523 <span data-processor="relativetime" data-value="2026-04-02T12:03:33+00:00" > 04/02/26, 12:03 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 93523 <span data-processor="relativetime" data-value="2026-04-02T12:13:12+00:00" > 04/02/26, 12:13 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 93523 <span data-processor="relativetime" data-value="2026-04-02T12:45:12+00:00" > 04/02/26, 12:45 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 93523 <span data-processor="relativetime" data-value="2026-04-02T13:06:15+00:00" > 04/02/26, 13:06 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 93523 <span data-processor="relativetime" data-value="2026-04-02T17:39:11+00:00" > 04/02/26, 17:39 </span>
-
Matthias Vogel commented and changed status
Under ReviewResolved done0 %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.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-04-21T11:30:33+00:00" > 04/21/26, 11:30 </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.