Search code examples
ckeditorckeditor4.xckeditor5

CKEditor5 - Source formatting / layout


I've recently switched from CKE4 to CKE5 and note a slightly annoying side-effect with source formatting.

If typing a few short lines, the editor applies paragraph tags, which is fine, but upon saving to our db for example, all lines are joined into one, where as CKE4 kept them in nicely separated.

With CKE4 :

<p> Hello World </p>
<p> Testing 12345 </p>

With CKE5

<p> Hello World </p><p> Testing 12345 </p>

Is there a parameter to change this ?

thanks in advance


Solution

  • I've handled this database side using replace and adding in line break - seems to work well now.

    SET @myField= replace(@myField,'</p>','</p>' + (CHAR(13) + CHAR(10)) + (CHAR(13) + CHAR(10)))