8
0
Maciej Bukowski 8 лет назад
Родитель
Сommit
32ee051be5

+ 2 - 2
packages/ckeditor5-engine/src/dev-utils/model.js

@@ -219,12 +219,12 @@ export function stringify( node, selectionOrPositionOrRange = null ) {
 	modelToView.on( 'selection', convertRangeSelection() );
 	modelToView.on( 'selection', convertRangeSelection() );
 	modelToView.on( 'selection', convertCollapsedSelection() );
 	modelToView.on( 'selection', convertCollapsedSelection() );
 
 
-	// Convert model to view.w
+	// Convert model to view.
 	modelToView.convertInsert( range );
 	modelToView.convertInsert( range );
 
 
 	// Convert model selection to view selection.
 	// Convert model selection to view selection.
 	if ( selection ) {
 	if ( selection ) {
-		modelToView.convertSelection( selection, [] );
+		modelToView.convertSelection( selection );
 	}
 	}
 
 
 	// Parse view to data string.
 	// Parse view to data string.

+ 5 - 4
packages/ckeditor5-engine/src/dev-utils/view.js

@@ -135,8 +135,7 @@ setData._parse = parse;
  *		const text = new Text( 'foobar' );
  *		const text = new Text( 'foobar' );
  *		const b = new Element( 'b', null, text );
  *		const b = new Element( 'b', null, text );
  *		const p = new Element( 'p', null, b );
  *		const p = new Element( 'p', null, b );
- *		const selection = new Selection();
- *		selection.setTo( Range.createFromParentsAndOffsets( text, 1, text, 5 ) );
+ *		const selection = new Selection( [ Range.createFromParentsAndOffsets( text, 1, text, 5 ) ] );
  *
  *
  *		stringify( p, selection ); // '<p><b>f{ooba}r</b></p>'
  *		stringify( p, selection ); // '<p><b>f{ooba}r</b></p>'
  *
  *
@@ -148,8 +147,10 @@ setData._parse = parse;
  *
  *
  *		const text = new Text( 'foobar' );
  *		const text = new Text( 'foobar' );
  *		const selection = new Selection();
  *		const selection = new Selection();
- *		selection.setTo( Range.createFromParentsAndOffsets( text, 0, text, 1 ) );
- *		selection.setTo( Range.createFromParentsAndOffsets( text, 3, text, 5 ) );
+ *		selection.setTo( [
+	 		Range.createFromParentsAndOffsets( text, 0, text, 1 ) ),
+ *			Range.createFromParentsAndOffsets( text, 3, text, 5 ) )
+ *		] );
  *
  *
  *		stringify( text, selection ); // '{f}oo{ba}r'
  *		stringify( text, selection ); // '{f}oo{ba}r'
  *
  *