From ba404ce8e7a48b77354f079478d1705b08d2e58a Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Mon, 10 Apr 2017 12:59:14 +0200 Subject: [PATCH] Changed: `caption` in schema now inherits from `$block`. --- src/imagecaption/imagecaptionengine.js | 2 +- tests/imagecaption/imagecaptionengine.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imagecaption/imagecaptionengine.js b/src/imagecaption/imagecaptionengine.js index 0ec52e3a..da18e930 100644 --- a/src/imagecaption/imagecaptionengine.js +++ b/src/imagecaption/imagecaptionengine.js @@ -61,7 +61,7 @@ export default class ImageCaptionEngine extends Plugin { this._createCaption = captionElementCreator( viewDocument, t( 'Enter image caption' ) ); // Schema configuration. - schema.registerItem( 'caption' ); + schema.registerItem( 'caption', '$block' ); schema.allow( { name: '$inline', inside: 'caption' } ); schema.allow( { name: 'caption', inside: 'image' } ); schema.limits.add( 'caption' ); diff --git a/tests/imagecaption/imagecaptionengine.js b/tests/imagecaption/imagecaptionengine.js index 0b6d3c46..54f072d1 100644 --- a/tests/imagecaption/imagecaptionengine.js +++ b/tests/imagecaption/imagecaptionengine.js @@ -46,6 +46,7 @@ describe( 'ImageCaptionEngine', () => { it( 'should set proper schema rules', () => { expect( document.schema.check( { name: 'caption', iniside: 'image' } ) ).to.be.true; expect( document.schema.check( { name: '$inline', inside: 'caption' } ) ).to.be.true; + expect( document.schema.itemExtends( 'caption', '$block' ) ).to.be.true; expect( document.schema.limits.has( 'caption' ) ); } );