Преглед изворни кода

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 ) {