CKEditor4 <br> tags are inserted inside empty <p></p> blocks

元气小坏坏 提交于 2019-12-11 04:15:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!