FluidTYPO3 / fluidcontent

TYPO3 extension Fluidcontent: Fluid Content Element Engine
71 stars 64 forks source link

Empty lines from RTE CKEditor should be remove while storing in the database #421

Closed vaxul closed 7 years ago

vaxul commented 7 years ago

Hello,

I have an odd case. Maybe it's more a problem from flux than fluidcontent.

The System

The problem

If I add multiple paragraphs and saving a content element with this RTE text, I get empty paragraphs between each real paragraphs in the frontend.

If I reopen the content element in the backend I get the same problem.

For example

If I add to paragraphs in the RTE like

line one
line two

I get the following code in the frontend:

<p>line one</p>
<p>&nbsp;</p>
<p>line-two</p>

The cause

I'm currently looking for the root of this problem.

What I know so far: The RTE produces in the source:

<p>line one</p>

<p>line-two</p>

I noticed the empty line which is saved directly into the Database with the p's like:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
    <data>
        <sheet index="options">
            <language index="lDEF">
                <field index="bodytext">
                    <value index="vDEF">&lt;p&gt;line one&lt;/p&gt;

&lt;p&gt;line two&lt;/p&gt;</value>
                </field>
            </language>
        </sheet>
    </data>
</T3FlexForms>

It seems, that this empty line get transformed to this empty p-tags.

I tested the same example in the native CType "text". In the database the column bodytext in tt_content have the following content

<p>line one</p>
<p>line two</p>

So the empty line seems to get removed while saving the content.

I'm currently searching for the code that puts the RTE content in the pi_flexform.

Best regards

vaxul


Maybe related issue in forge for ck_editor: https://forge.typo3.org/issues/79216

May we should fix this in the RTE. But If it's working in the native content elements, shouldn't it in the fluidcontent elements too?

vaxul commented 7 years ago

Move the issue to flux https://github.com/FluidTYPO3/flux/issues/1447