Jelajahi Sumber

Simplify canBeCodeBlock() schema check return value.

Maciej Gołaszewski 6 tahun lalu
induk
melakukan
3fcbc0a6b6
1 mengubah file dengan 1 tambahan dan 5 penghapusan
  1. 1 5
      packages/ckeditor5-code-block/src/codeblockcommand.js

+ 1 - 5
packages/ckeditor5-code-block/src/codeblockcommand.js

@@ -156,9 +156,5 @@ function canBeCodeBlock( schema, element ) {
 		return false;
 	}
 
-	if ( !schema.checkChild( element.parent, 'codeBlock' ) ) {
-		return false;
-	}
-
-	return true;
+	return schema.checkChild( element.parent, 'codeBlock' );
 }