ソースを参照

Fixed failing test.

Kamil Piechaczek 5 年 前
コミット
454bab1d4c

+ 1 - 6
packages/ckeditor5-clipboard/src/clipboard.js

@@ -105,12 +105,7 @@ export default class Clipboard extends Plugin {
 
 				// While pasting plain text, apply selection attributes on the text.
 				if ( isPlainText( modelFragment ) ) {
-					let node = modelFragment.getChild( 0 );
-
-					// Pasting a paragraph with text without styles.
-					if ( !node.is( 'text' ) ) {
-						node = node.getChild( 0 );
-					}
+					const node = modelFragment.getChild( 0 );
 
 					model.change( writer => {
 						writer.setAttributes( modelDocument.selection.getAttributes(), node );

+ 1 - 1
packages/ckeditor5-clipboard/tests/clipboard.js

@@ -405,7 +405,7 @@ describe( 'Clipboard feature', () => {
 				setModelData( model, '<paragraph><$text bold="true">Bolded []text.</$text></paragraph>' );
 
 				const dataTransferMock = createDataTransfer( {
-					'text/html': '<p>foo</p>',
+					'text/html': 'foo',
 					'text/plain': 'foo'
 				} );