8
0
Просмотр исходного кода

The generic $block should be marked to be a block.

Piotrek Koszuliński 8 лет назад
Родитель
Сommit
3d6425aad4

+ 10 - 3
packages/ckeditor5-engine/src/model/model.js

@@ -70,9 +70,16 @@ export default class Model {
 			.forEach( methodName => this.decorate( methodName ) );
 			.forEach( methodName => this.decorate( methodName ) );
 
 
 		// Register some default abstract entities.
 		// Register some default abstract entities.
-		this.schema.register( '$root', { isLimit: true } );
-		this.schema.register( '$block', { allowIn: '$root' } );
-		this.schema.register( '$text', { allowIn: '$block' } );
+		this.schema.register( '$root', {
+			isLimit: true
+		} );
+		this.schema.register( '$block', {
+			allowIn: '$root',
+			isBlock: true
+		} );
+		this.schema.register( '$text', {
+			allowIn: '$block'
+		} );
 
 
 		// TODO review
 		// TODO review
 		// Create an "all allowed" context in the schema for processing the pasted content.
 		// Create an "all allowed" context in the schema for processing the pasted content.

+ 1 - 1
packages/ckeditor5-engine/tests/model/schema.js

@@ -1658,6 +1658,6 @@ describe( 'Schema', () => {
 	// * review insertContent's _tryAutoparagraphing()
 	// * review insertContent's _tryAutoparagraphing()
 	// * it doesn't make sense for VCD to get schema as a param (it can get it from the model)
 	// * it doesn't make sense for VCD to get schema as a param (it can get it from the model)
 	// * V->M conversion tests might got outdated and would need to be reviewed if someone has a spare week ;)
 	// * V->M conversion tests might got outdated and would need to be reviewed if someone has a spare week ;)
-	// * Do we need both $inline and $text?
+	// * Do we need both $inline and $text? It seems that it makes more sense to have "isInline" in the future.
 	// * Consider reversing context array for writing simpler callbacks
 	// * Consider reversing context array for writing simpler callbacks
 } );
 } );