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

Commit

Permalink
Merge branch 'master' into t/ckeditor5-engine/1210
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonkups committed Feb 1, 2018
2 parents 632df26 + 3b24fbf commit f1290ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export function viewModelConverter( evt, data, conversionApi ) {
// `listItem`s created recursively should have bigger indent.
conversionStore.indent++;

writer.insert( listItem, data.cursorPosition );
writer.insert( listItem, data.modelCursor );

// Remember position after list item.
let nextPosition = ModelPosition.createAfter( listItem );
Expand All @@ -383,7 +383,7 @@ export function viewModelConverter( evt, data, conversionApi ) {
for ( const child of data.viewItem.getChildren() ) {
// If this is a view list element, we will convert it after last `listItem` model element.
if ( child.name == 'ul' || child.name == 'ol' ) {
nextPosition = conversionApi.convertItem( child, nextPosition ).cursorPosition;
nextPosition = conversionApi.convertItem( child, nextPosition ).modelCursor;
}
// If it was not a list it was a "regular" list item content. Just append it to `listItem`.
else {
Expand All @@ -393,8 +393,8 @@ export function viewModelConverter( evt, data, conversionApi ) {

conversionStore.indent--;

data.modelRange = new ModelRange( data.cursorPosition, nextPosition );
data.cursorPosition = data.modelRange.end;
data.modelRange = new ModelRange( data.modelCursor, nextPosition );
data.modelCursor = data.modelRange.end;
}
}

Expand Down

0 comments on commit f1290ed

Please sign in to comment.