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

Commit

Permalink
Internal: Updated schema use. See ckeditor/ckeditor5-engine#1234.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Jan 24, 2018
1 parent 479d043 commit abac294
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/deletecommand.js
Expand Up @@ -244,12 +244,9 @@ describe( 'DeleteCommand', () => {
} );

it( 'does not replace an element if a paragraph is not allowed in current position', () => {
model.schema.on( 'checkChild', ( evt, args ) => {
const def = model.schema.getDefinition( args[ 1 ] );

if ( args[ 0 ].endsWith( '$root' ) && def.name == 'paragraph' ) {
evt.stop();
evt.return = false;
model.schema.addChildCheck( ( ctx, childDef ) => {
if ( ctx.endsWith( '$root' ) && childDef.name == 'paragraph' ) {
return false;
}
} );

Expand Down

0 comments on commit abac294

Please sign in to comment.