浏览代码

Changed: `caption` in schema now inherits from `$block`.

Szymon Cofalik 8 年之前
父节点
当前提交
7cb31e69a9

+ 1 - 1
packages/ckeditor5-image/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' );

+ 1 - 0
packages/ckeditor5-image/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' ) );
 	} );