8
0
Просмотр исходного кода

Merge branch 'master' into t/117

Piotrek Koszuliński 8 лет назад
Родитель
Сommit
37000e241c

+ 1 - 1
packages/ckeditor5-typing/package.json

@@ -12,7 +12,7 @@
     "@ckeditor/ckeditor5-utils": "^0.10.0"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-dev-lint": "^3.1.1",
+    "@ckeditor/ckeditor5-dev-lint": "^3.1.4",
     "@ckeditor/ckeditor5-basic-styles": "^0.9.0",
     "@ckeditor/ckeditor5-editor-classic": "^0.8.0",
     "@ckeditor/ckeditor5-enter": "^0.10.0",

+ 3 - 1
packages/ckeditor5-typing/src/inputcommand.js

@@ -84,7 +84,9 @@ export default class InputCommand extends Command {
 				this._buffer.batch.remove( range );
 			}
 
-			this._buffer.batch.weakInsert( range.start, text );
+			if ( text ) {
+				this._buffer.batch.weakInsert( range.start, text );
+			}
 
 			if ( resultRange ) {
 				this.editor.data.model.selection.setRanges( [ resultRange ] );

+ 1 - 1
packages/ckeditor5-typing/src/typing.js

@@ -41,7 +41,7 @@ export default class Typing extends Plugin {
  * The configuration of the typing features. Used by the typing features in `@ckeditor/ckeditor5-typing` package.
  *
  *		ClassicEditor
- *			.create( {
+ *			.create( editorElement, {
  * 				typing: ... // Typing feature options.
  *			} )
  *			.then( ... )

+ 10 - 0
packages/ckeditor5-typing/tests/inputcommand.js

@@ -216,6 +216,16 @@ describe( 'InputCommand', () => {
 			expect( getData( doc, { selection: true } ) ).to.be.equal( '<p>fo[]obar</p>' );
 			expect( buffer.size ).to.be.equal( 0 );
 		} );
+
+		it( 'does not create insert delta when no text given', () => {
+			setData( doc, '<p>foo[]bar</p>' );
+
+			const version = doc.version;
+
+			editor.execute( 'input' );
+
+			expect( doc.version ).to.equal( version );
+		} );
 	} );
 
 	describe( 'destroy', () => {