问题
I used the following way to render some content into div by using CKEditor4:
// the config is my CKEDITOR.config
// this._editorElement is the element in which I will render my CKEditor
const myEditor: CKEDITOR.editor = CKEDITOR.inline(this._editorElement, config);
myEditor.setData("<p></p><div>aaa</div><p></p><div>bbb</div>");
However, after the content was rendered into the page, it changed into:
<p><br></p><div>aaa</div><p><br></p><div>bbb</div>
.
As you can see, <br>
is inserted into empty <p></p>
blocks. However, I don't want this to happen. How to solve this problem?
来源:https://stackoverflow.com/questions/40719121/ckeditor4-br-tags-are-inserted-inside-empty-p-p-blocks