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

Commit

Permalink
Merge pull request #95 from ckeditor/t/94
Browse files Browse the repository at this point in the history
Fix: The `caption` item should inherit from `$block` to automatically allow the same content. Closes #94.
  • Loading branch information
Reinmar authored Apr 11, 2017
2 parents d3d26fa + ba404ce commit 02869eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/imagecaption/imagecaptionengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
1 change: 1 addition & 0 deletions tests/imagecaption/imagecaptionengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
} );

Expand Down

0 comments on commit 02869eb

Please sign in to comment.