Browse Source

"Schema#checkAttributeInSelection()" should use current text node or a generic "$text".

Kamil Piechaczek 7 years ago
parent
commit
b0b3132d95
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/ckeditor5-engine/src/model/schema.js

+ 2 - 2
packages/ckeditor5-engine/src/model/schema.js

@@ -491,8 +491,8 @@ export default class Schema {
 			const firstPosition = selection.getFirstPosition();
 			const context = [
 				...firstPosition.getAncestors(),
-				firstPosition.root.getNodeByPath( firstPosition.path )
-			].filter( Boolean );
+				firstPosition.root.getNodeByPath( firstPosition.path ) || '$text'
+			];
 
 			// Check whether schema allows for a text with the attribute in the selection.
 			return this.checkAttribute( context, attribute );