diff --git a/packages/blocks/src/api/raw-handling/html-formatting-remover.js b/packages/blocks/src/api/raw-handling/html-formatting-remover.js index 615feb80508a98..d097f8323bd109 100644 --- a/packages/blocks/src/api/raw-handling/html-formatting-remover.js +++ b/packages/blocks/src/api/raw-handling/html-formatting-remover.js @@ -42,7 +42,7 @@ export default function( node ) { } // Ignore pre content. - if ( node.parentElement.closest( 'pre' ) ) { + if ( node.parentElement.closest && node.parentElement.closest( 'pre' ) ) { return; }