|
|
@@ -27,16 +27,16 @@ describe( 'HeadingCommand', () => {
|
|
|
schema = model.schema;
|
|
|
|
|
|
editor.commands.add( 'paragraph', new ParagraphCommand( editor ) );
|
|
|
- schema.registerItem( 'paragraph', '$block' );
|
|
|
+ schema.register( 'paragraph', { inheritAllFrom: '$block' } );
|
|
|
|
|
|
for ( const option of options ) {
|
|
|
commands[ option.modelElement ] = new HeadingCommand( editor, option.modelElement );
|
|
|
- schema.registerItem( option.modelElement, '$block' );
|
|
|
+ schema.register( option.modelElement, '$block' );
|
|
|
}
|
|
|
|
|
|
- schema.registerItem( 'notBlock' );
|
|
|
- schema.allow( { name: 'notBlock', inside: '$root' } );
|
|
|
- schema.allow( { name: '$text', inside: 'notBlock' } );
|
|
|
+ schema.register( 'notBlock' );
|
|
|
+ schema.extend( 'notBlock', { allowIn: '$root' } );
|
|
|
+ schema.extend( '$text', { allowIn: 'notBlock' } );
|
|
|
|
|
|
root = document.getRoot();
|
|
|
} );
|
|
|
@@ -113,12 +113,12 @@ describe( 'HeadingCommand', () => {
|
|
|
|
|
|
// https://github.com/ckeditor/ckeditor5-heading/issues/73
|
|
|
it( 'should not rename blocks which cannot become headings', () => {
|
|
|
- schema.registerItem( 'restricted' );
|
|
|
- schema.allow( { name: 'restricted', inside: '$root' } );
|
|
|
- schema.disallow( { name: 'heading1', inside: 'restricted' } );
|
|
|
+ schema.register( 'restricted' );
|
|
|
+ schema.extend( 'restricted', { allowIn: '$root' } );
|
|
|
+ schema.dis.extend( 'heading1', { allowIn: 'restricted' } );
|
|
|
|
|
|
- schema.registerItem( 'fooBlock', '$block' );
|
|
|
- schema.allow( { name: 'fooBlock', inside: 'restricted' } );
|
|
|
+ schema.register( 'fooBlock', { inheritAllFrom: '$block' } );
|
|
|
+ schema.extend( 'fooBlock', { allowIn: 'restricted' } );
|
|
|
|
|
|
setData(
|
|
|
model,
|
|
|
@@ -166,8 +166,8 @@ describe( 'HeadingCommand', () => {
|
|
|
} );
|
|
|
|
|
|
it( 'converts topmost blocks', () => {
|
|
|
- schema.registerItem( 'inlineImage', '$inline' );
|
|
|
- schema.allow( { name: '$text', inside: 'inlineImage' } );
|
|
|
+ schema.register( 'inlineImage', { allowWhere: '$text' } );
|
|
|
+ schema.extend( '$text', { allowIn: 'inlineImage' } );
|
|
|
|
|
|
setData( model, '<paragraph><inlineImage>foo[]</inlineImage>bar</paragraph>' );
|
|
|
commands.heading1.execute();
|