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

Changed: caption in schema now inherits from $block. #95

Merged
merged 1 commit into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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