diff --git a/plugins/woocommerce-blocks/assets/js/atomic/utils/render-parent-block.tsx b/plugins/woocommerce-blocks/assets/js/atomic/utils/render-parent-block.tsx index 913371d0983..5dbb6497510 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/utils/render-parent-block.tsx +++ b/plugins/woocommerce-blocks/assets/js/atomic/utils/render-parent-block.tsx @@ -179,6 +179,11 @@ const renderInnerBlocks = ( { return null; } + // Return scripts without manipulation. + if ( parsedElement?.type === 'script' ) { + return parsedElement; + } + const renderedChildren = node.childNodes.length ? renderInnerBlocks( { block, diff --git a/plugins/woocommerce/changelog/fix-inner-block-script-handling-51155 b/plugins/woocommerce/changelog/fix-inner-block-script-handling-51155 new file mode 100644 index 00000000000..554cddf0949 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-inner-block-script-handling-51155 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix script tag handling for inner blocks in the cart