Przeglądaj źródła

Move generic nromalizer as last one which will be always active.

Mateusz Samsel 6 lat temu
rodzic
commit
698129d111

+ 3 - 5
packages/ckeditor5-paste-from-office/src/pastefromoffice.js

@@ -50,11 +50,13 @@ export default class PasteFromOffice extends Plugin {
 	init() {
 		const editor = this.editor;
 		const normalizers = [];
-		const genericNormalizer = new GenericNormalizer();
 
 		normalizers.push( new MSWordNormalizer() );
 		normalizers.push( new GoogleDocsNormalizer() );
 
+		// GenericNormalizers has to be added as last one, as it always will be activated.
+		normalizers.push( new GenericNormalizer() );
+
 		editor.plugins.get( 'Clipboard' ).on(
 			'inputTransformation',
 			( evt, data ) => {
@@ -68,10 +70,6 @@ export default class PasteFromOffice extends Plugin {
 				if ( activeNormalizer ) {
 					activeNormalizer.execute( data );
 
-					data.isTransformedWithPasteFromOffice = true;
-				} else {
-					genericNormalizer.execute( data );
-
 					data.isTransformedWithPasteFromOffice = true;
 				}
 			},