8
0
Quellcode durchsuchen

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

Kamil Piechaczek vor 7 Jahren
Ursprung
Commit
b0b3132d95
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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 );