Skip to content

Commit

Permalink
Footnotes: Attempt to iterate into nested blocks that use useInnerBlo…
Browse files Browse the repository at this point in the history
…cksProps in the save function
  • Loading branch information
andrewserong committed Jul 17, 2023
1 parent 5e44d3d commit 7332ba6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function addValuesForElement( element, ...args ) {
case Fragment:
return addValuesForElements( props.children, ...args );
case RawHTML:
return;
// `useInnerBlocksProps.save()` will return a `RawHTML` element,
// so use this as an indicator to recurse into the children.
return addValuesForBlocks( ...args );
case InnerBlocks.Content:
return addValuesForBlocks( ...args );
case Content:
Expand Down Expand Up @@ -81,7 +83,7 @@ function addValuesForElements( children, ...args ) {
function addValuesForBlocks( values, blocks ) {
for ( let i = 0; i < blocks.length; i++ ) {
const { name, attributes, innerBlocks } = blocks[ i ];
const saveElement = getSaveElement( name, attributes );
const saveElement = getSaveElement( name, attributes, innerBlocks );
addValuesForElement( saveElement, values, innerBlocks );
}
}
Expand Down

0 comments on commit 7332ba6

Please sign in to comment.