diff --git a/packages/block-library/src/embed/transforms.js b/packages/block-library/src/embed/transforms.js index 1e955b34dc0d6..c2db0d435b116 100644 --- a/packages/block-library/src/embed/transforms.js +++ b/packages/block-library/src/embed/transforms.js @@ -21,7 +21,7 @@ const transforms = { isMatch: ( node ) => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test( node.textContent ) && - node.textContent?.match( /https/gi ).length === 1, + node.textContent?.match( /https/gi )?.length === 1, transform: ( node ) => { return createBlock( EMBED_BLOCK, { url: node.textContent.trim(),