浏览代码

Prevent of removing empty node in some special cases.

Mateusz Samsel 6 年之前
父节点
当前提交
b9c37e358c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/ckeditor5-engine/src/model/utils/insertcontent.js

+ 1 - 1
packages/ckeditor5-engine/src/model/utils/insertcontent.js

@@ -562,7 +562,7 @@ class Insertion {
 
 				// Special case – parent is empty (<p>^</p>).
 				// We can remove the element after moving insertion position out of it.
-				if ( parent.isEmpty ) {
+				if ( parent.isEmpty && parent.parent === allowedIn ) {
 					this.writer.remove( parent );
 				}
 			} else if ( this.position.isAtEnd ) {