#97817RTE removes line with empty, allowed tags when saving
Description
Lines with only tags which are “empty” (not containing any text content) by definition but which are allowed in the configuration can be removed when saving the RTE contents if they happen to also contain a single
The offending paragraph was:
<p> <audio controls=""><source src="/fileadmin/filer/Lyd/Dansk_Lydhistorie__Statsbiblioteket/Dialekter/Dialekt_fra_Anholt__Djurs_.mp3" type="audio/mpeg" /></audio> </p>
Both the audio and source tags were configured as allowed.
In \TYPO3\CMS\Core\Html\RteHtmlParser::divideIntoLines() there is a check to see if the line is considered as “empty”: https://github.com/TYPO3/typo3/blob/10.4/typo3/sysext/core/Classes/Html/RteHtmlParser.php#L656-L661
First it strips all tags and if a single is left
it checks to see if there is no img tag present
and no attributes from a set of general attributes present
if all these three conditions are met the line is considered “empty” and the contents are removed.
The check for a single is strange in itself, but not very relevant in this case.
The second check for the img tag probably wants to consider this tag as “content”. A picture element must contain an img element and is content, an img element on its own is content, but audio and video elements only contain source elements to define their content.
A solution would be to also consider “source” elements as content.
Reviews 2
History 26
-
Gerrit Code Review pushed patch set 1 for main to change 96174 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-29T19:00:28+00:00" > 09/29/26, 19:00 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 96248 <span data-processor="relativetime" data-value="2026-10-01T06:20:58+00:00" > 10/01/26, 06:20 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 96248 <span data-processor="relativetime" data-value="2026-10-01T06:46:15+00:00" > 10/01/26, 06:46 </span>
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-01T06:50:10+00:00" > 10/01/26, 06:50 </span> -
Gerrit Code Review pushed patch set 3 for 14.3 to change 96248 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-10-01T07:07:29+00:00" > 10/01/26, 07:07 </span> -
Georg Ringer commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-10-01T07:30:13+00:00" > 10/01/26, 07:30 </span>Applied in changeset commit:5a06cf5cabf29fed06f2c4774e93d1e39d2407b9.
Applied in changeset commit:2e75c5f573661cfde15011404d8e03a56c0d2591.