CKEditor removes <br> tags within <div> tags - how to stop this?

735 Views Asked by At

I have a document that contains:

<div><br/></div>

When CKEditor loads this (via calling setData()), and I examine the DOM with Chrome Developer Tools, it is retained.

However, if I call getData(false), I get back:

<div></div>

Even when I turn off filtering by setting allowedContent=true, don't disallow any content with disallowedContent, etc., the above still happens.

The only way I've found to stop this from happening is by changing the HTML to be:

<div data-cke-processor="off"><br/></div>

This works; but I can't make sure the incoming HTML is set up this way.

Does anyone know why CKEditor is doing this, even if I turn filtering completely off as in the above?

I'm using CKEditor 4.7 (the latest as of this date).

0

There are 0 best solutions below