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

Commit

Permalink
Improve code readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarwrobel committed Feb 6, 2018
1 parent 815ce85 commit 35e6326
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/conversion/view-to-model-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export function convertToModelFragment() {
return ( evt, data, conversionApi ) => {
// Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.
if ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
data = Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
data.modelCursor = data.modelRange.end;
const { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );

data.modelRange = modelRange;
data.modelCursor = modelCursor;
}
};
}
Expand Down

0 comments on commit 35e6326

Please sign in to comment.