Jelajahi Sumber

Simplified some code.

Oskar Wróbel 8 tahun lalu
induk
melakukan
5724dfa3d6

+ 1 - 5
packages/ckeditor5-engine/src/conversion/viewconversiondispatcher.js

@@ -218,12 +218,8 @@ export default class ViewConversionDispatcher {
 		for ( const viewChild of Array.from( input.getChildren() ) ) {
 			const modelChild = this._convertItem( viewChild, consumable, additionalData );
 
-			if ( modelChild instanceof ModelNode ) {
+			if ( modelChild instanceof ModelNode || modelChild instanceof ModelDocumentFragment ) {
 				batch.append( modelChild, documentFragment );
-			} else if ( modelChild instanceof ModelDocumentFragment ) {
-				for ( const child of Array.from( modelChild ) ) {
-					batch.append( child, documentFragment );
-				}
 			}
 		}
 

+ 1 - 1
packages/ckeditor5-engine/src/model/documentselection.js

@@ -723,7 +723,7 @@ function clearAttributesStoredInElement( changes, batch, document ) {
 
 	// `changes.range` is not set in case of rename, root and marker operations.
 	// None of them may lead to the element becoming non-empty.
-	if ( !changeParent || changeParent.is( 'documentFragment' ) || changeParent.isEmpty ) {
+	if ( !changeParent || changeParent.isEmpty ) {
 		return;
 	}