#88556One line break in DB field causes 3 rendered p-tags in CKEditor
Description
<p>Hello World
</p><ul><li>foo bar</li></ul>
When writing this into a DB field with enabled RTE it causes 3 additional empty p-tags in CKEditor. These can be saved too. See attachment for a sample.
Not sure whether this is a CKEditor or TYPO3 related issue.
Reviews 3
Related issues 1
Files 7
History 1720
-
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2019-06-13T13:37:33+00:00" > 06/13/19, 13:37 </span> -
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-06-13T13:40:26+00:00" > 06/13/19, 13:40 </span>
Benni Mack wrote:
> Are you using the RTE in a FlexForm?No, I use it in a TCA.
When removing the single existing line break between “World” and closing p-tag no additional line breaks are created. I have switched temporary to T3’s default preset but the behaviour was the same.
That’s my TCA field config:
<?php 'myField' => [ 'exclude' => 1, 'label' => $ll . 'myField', 'config' => [ 'type' => 'text', 'cols' => 40, 'rows' => 15, 'eval' => 'trim', 'enableRichtext' => true, ], ], -
Riccardo De Contardi commented and changed status
Needs FeedbackNew <span data-processor="relativetime" data-value="2019-06-29T21:50:09+00:00" > 06/29/19, 21:50 </span>Is this somehow related? #88655
-
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-07-02T12:07:18+00:00" > 07/02/19, 12:07 </span>
Riccardo De Contardi wrote:
> Is this somehow related? #88655I will check within this week.
-
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-07-08T18:57:16+00:00" > 07/08/19, 18:57 </span>
I don’t think this is related as #88655 is about ignored RTE config. whereas this issue is rather related to DB=>CKEditor parse-process.
-
Susanne Moog changed Tags
ckeditorckeditor,CodingNight <span data-processor="relativetime" data-value="2019-08-02T19:37:00+00:00" > 08/02/19, 19:37 </span> -
Benni Mack commented <span data-processor="relativetime" data-value="2019-08-16T12:46:29+00:00" > 08/16/19, 12:46 </span>
Alex Nostadt wrote:
> I don’t think this is related as #88655 is about ignored RTE config. whereas this issue is rather related to DB=>CKEditor parse-process.Can you share your CKEditor config? (if you have a manually configured RTE configuration) just to be sure.
-
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-08-17T09:05:59+00:00" > 08/17/19, 09:05 </span>
Benni Mack wrote:
> Alex Nostadt wrote:
> > I don’t think this is related as #88655 is about ignored RTE config. whereas this issue is rather related to DB=>CKEditor parse-process.
>
> Can you share your CKEditor config? (if you have a manually configured RTE configuration) just to be sure.I could reproduce it with the default T3 config as well but can provide it as well within the next days.
-
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-08-26T15:38:15+00:00" > 08/26/19, 15:38 </span>
Alex Nostadt wrote:
> Benni Mack wrote:
> > Alex Nostadt wrote:
> > > I don’t think this is related as #88655 is about ignored RTE config. whereas this issue is rather related to DB=>CKEditor parse-process.
> >
> > Can you share your CKEditor config? (if you have a manually configured RTE configuration) just to be sure.
>
> I could reproduce it with the default T3 config as well but can provide it as well within the next days.Sorry, forgot this ticket. Add this to my priority list now.
-
Alex Nostadt commented <span data-processor="relativetime" data-value="2019-08-30T08:42:51+00:00" > 08/30/19, 08:42 </span>
That’s the RTE configuration:
(I include Specific.yaml. We have multiple “Specific.yaml” files and our Default.yaml is our common denominator)
*Default.yaml*imports: - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" } - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" } - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" } - { resource: "EXT:rte_ckeditor_image/Configuration/RTE/Plugin.yaml" } processing: ## allowed default attributes (added by us is..: "style") allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop, style] editor: externalPlugins: find: resource: "EXT:provider/Resources/Public/CKEditor/Plugins/find/" config: # can be "default", but a custom stylesSet can be defined here, which fits TYPO3 best stylesSet: - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:align-center", element: "p", styles: { text-align: "center"} } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:justify", element: "p", styles: { text-align: "justify"} } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:author", element: "p", attributes: { class: 'author' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:citation", element: "p", attributes: { class: 'citation' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:check", element: ["ul"], attributes: { class: 'check' } } toolbarGroups: - { name: styles, groups: [ styles ] } - "/" - { name: editing, groups: [ find, selection, spellchecker, editing ] } - { name: forms, groups: [ forms ] } - { name: basicstyles, groups: [ basicstyles, cleanup ] } - { name: paragraph, groups: [ list, indent, blocks, align, bidi, paragraph ] } - { name: links, groups: [ links ] } - { name: insert, groups: [ insert ] } - { name: colors, groups: [ colors ] } - { name: others, groups: [ others ] } - "/" - { name: clipboard, groups: [ clipboard, undo ] } - { name: document, groups: [ mode, document, doctools ] } - { name: tools, groups: [ tools ] } - { name: about, groups: [ about ] } format_tags: "p;h1;h2;h3;h4" justifyClasses: - text-left - text-center - text-right - text-justify buttons: link: url: properties: class: default: 'external-link' properties: class: allowedClasses: 'external-link' classes: external-link: name: 'External Link' classesAnchor: externalLink: class: 'external-link' type: 'url' target: '_blank' removeButtons: - Save - NewPage - Preview - Print - Templates - Cut - Copy - Paste - PasteFromWord - Form - Checkbox - Radio, - TextField - Textarea - Select - Button - ImageButton - HiddenField - Outdent - Indent - Flash - HorizontalRule - Smiley - PageBreak - Iframe - Font - FontSize - TextColor - BGColor - ShowBlocks - Blockquote - AboutSpecific.yaml
imports: - { resource: "EXT:provider/Configuration/RTE/Default.yaml" } editor: externalPlugins: placeholder_select: resource: "EXT:provider/Resources/Public/CKEditor/Plugins/placeholder_select/" config: contentsCss: ["EXT:rte_ckeditor/Resources/Public/Css/contents.css", "EXT:provider/Resources/Public/Css/editor.css"] # can be "default", but a custom stylesSet can be defined here, which fits TYPO3 best stylesSet: - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:large", element: ["p", "ul", "ol", "h1", "h2", "h3"], attributes: { class: 'large' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:teaser-text", element: "p", attributes: { class: 'teaser-text' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:light-gray", element: ["p", "ul", "ol"], attributes: { class: 'light-gray' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:all-borders", element: "table", attributes: { class: 'all-borders' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:horizontal-borders", element: "table", attributes: { class: 'horizontal-borders' } } - { name: "LLL:EXT:provider/Resources/Private/Language/rte.xlf:vertical-borders", element: "table", attributes: { class: 'vertical-borders' } } -
Susanne Moog changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2022-08-05T13:36:03+00:00" > 08/05/22, 13:36 </span>
-
Oliver Hader changed Sprint Focus
On Location Sprint<span data-processor="relativetime" data-value="2022-11-03T09:04:21+00:00" > 11/03/22, 09:04 </span> -
David Menzel commented and changed attached db_field_value.jpg attached rte_view.jpg attached rte_view_sourcecode.jpg attached fe_output.jpg attached fe_output_sourcecode.jpg attached db_field_value_wo_linebreak.jpg TYPO3 Version
811 PHP Version7.27.4 <span data-processor="relativetime" data-value="2023-08-07T18:58:28+00:00" > 08/07/23, 18:58 </span>We have the same problem since (at least) TYPO3 10. Now using TYPO3 11.
A bodytext database field has the following text:
The RTE ckeditor looks like this:
RTE ckeditor Source code view:
Output in FE:
FE source code:
You notice the additional empty p-Tags before/after the pre-tag?
However, when I remove the linebreaks in the database field:
db_field_value_wo_linebreak.jpgthe FE works and there are no additional empty p-tags.
When I save the RTE field again, the empty p-tags are back again because the linebreaks are back in the db field.Not sure why it only happens before/after the pre-tag.
TYPO3 11.5.30 and PHP 7.4
-
David Menzel commented and changed TYPO3 Version
1112 PHP Version7.48.2 <span data-processor="relativetime" data-value="2025-03-06T05:47:19+00:00" > 03/06/25, 05:47 </span>Problem still exists in TYPO3 12.4.27 and CKEditor 5.
There’s an additional empty-Tag before and after the codeblock.
-
Riccardo De Contardi changed Related to #96466 <span data-processor="relativetime" data-value="2025-04-06T14:41:00+00:00" > 04/06/25, 14:41 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95108 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-05T03:25:06+00:00" > 08/05/26, 03:25 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 95131 <span data-processor="relativetime" data-value="2026-08-06T19:26:43+00:00" > 08/06/26, 19:26 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 95132 <span data-processor="relativetime" data-value="2026-08-06T19:26:58+00:00" > 08/06/26, 19:26 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-08-06T20:15:08+00:00" > 08/06/26, 20:15 </span>Applied in changeset commit:b406a9416431d1945756ce418d9c3726844f5325.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-08-11T08:46:35+00:00" > 08/11/26, 08:46 </span>
Are you using the RTE in a FlexForm?