Kaynağa Gözat

Simplify canBeCodeBlock() schema check return value.

Maciej Gołaszewski 6 yıl önce
ebeveyn
işleme
3fcbc0a6b6

+ 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' );
 }