Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fixed docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jan 16, 2018
1 parent 002738d commit a012c2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/dev-utils/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ export function stringify( node, selectionOrPositionOrRange = null ) {
return new ViewAttributeElement( 'model-text-with-attributes', { [ data.key ]: value } );
} ) );

// Convert model to view.w
// Convert model to view.
modelToView.convertInsert( range );

// Convert model selection to view selection.
if ( selection ) {
modelToView.convertSelection( selection, [] );
modelToView.convertSelection( selection );
}

// Parse view to data string.
Expand Down
9 changes: 5 additions & 4 deletions src/dev-utils/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ setData._parse = parse;
* const text = new Text( 'foobar' );
* const b = new Element( 'b', null, text );
* 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>'
*
Expand All @@ -148,8 +147,10 @@ setData._parse = parse;
*
* const text = new Text( 'foobar' );
* 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'
*
Expand Down

0 comments on commit a012c2c

Please sign in to comment.