Explorar o código

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

Kamil Piechaczek %!s(int64=7) %!d(string=hai) anos
pai
achega
b0b3132d95
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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 );