Browse Source

Added 'limits' set to schema.

Szymon Kupś 8 years ago
parent
commit
30e9c70064

+ 8 - 0
packages/ckeditor5-engine/src/model/schema.js

@@ -49,6 +49,14 @@ export default class Schema {
 		this.objects = new Set();
 
 		/**
+		 * Names of elements which have "limited" nature. They should be treated as a single container that cannot be
+		 * split by enter key.
+		 *
+		 * @member {Set.<String>} module:engine/model/schema~Schema#limits
+		 */
+		this.limits = new Set();
+
+		/**
 		 * Schema items registered in the schema.
 		 *
 		 * @private

+ 4 - 0
packages/ckeditor5-engine/tests/model/schema/schema.js

@@ -43,6 +43,10 @@ describe( 'Schema', () => {
 			expect( schema.objects ).to.be.instanceOf( Set );
 		} );
 
+		it( 'should create the limits set', () => {
+			expect( schema.limits ).to.be.instanceOf( Set );
+		} );
+
 		describe( '$clipboardHolder', () => {
 			it( 'should allow $block', () => {
 				expect( schema.check( { name: '$block', inside: [ '$clipboardHolder' ] } ) ).to.be.true;