8
0
فهرست منبع

Merge pull request #95 from ckeditor/t/94

Fix: The `caption` item should inherit from `$block` to automatically allow the same content. Closes #94.
Piotrek Koszuliński 8 سال پیش
والد
کامیت
fb5529ec0d

+ 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' ) );
 	} );