瀏覽代碼

Merge pull request #68 from ckeditor/i/6072

Other: Added fix for track changes. Closes ckeditor/ckeditor5#6072.
Szymon Cofalik 5 年之前
父節點
當前提交
6ad5f937ce
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      packages/ckeditor5-enter/src/shiftentercommand.js

+ 4 - 4
packages/ckeditor5-enter/src/shiftentercommand.js

@@ -83,7 +83,7 @@ function softBreakAction( model, writer, selection ) {
 
 	if ( isSelectionEmpty ) {
 		const attributesToCopy = getCopyOnEnterAttributes( model.schema, selection.getAttributes() );
-		insertBreak( writer, range.end );
+		insertBreak( model, writer, range.end );
 
 		writer.removeSelectionAttribute( selection.getAttributeKeys() );
 		writer.setSelectionAttribute( attributesToCopy );
@@ -95,7 +95,7 @@ function softBreakAction( model, writer, selection ) {
 		//
 		// <h>x[xx]x</h>		-> <h>x^x</h>			-> <h>x<br>^x</h>
 		if ( isContainedWithinOneElement ) {
-			insertBreak( writer, selection.focus );
+			insertBreak( model, writer, selection.focus );
 		}
 		// Selection over multiple elements.
 		//
@@ -116,10 +116,10 @@ function softBreakAction( model, writer, selection ) {
 	}
 }
 
-function insertBreak( writer, position ) {
+function insertBreak( model, writer, position ) {
 	const breakLineElement = writer.createElement( 'softBreak' );
 
-	writer.insert( breakLineElement, position );
+	model.insertContent( breakLineElement, position );
 	writer.setSelection( breakLineElement, 'after' );
 }