Browse Source

Simplify canBeCodeBlock() schema check return value.

Maciej Gołaszewski 6 năm trước cách đây
mục cha
commit
3fcbc0a6b6
1 tập tin đã thay đổi với 1 bổ sung5 xóa
  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' );
 }