You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Footnotes: can't add footnotes to nested blocks #52628
From a little digging, I think this issue might have been introduced in #52241 as it appears to only recurse into nested blocks that use InnerBlocks.Content (the Group block doesn't). We could try tweaking the logic slightly so that it always looks at the innerBlocks array instead? I might give that a try so that we have something to play with / test and see if that helps resolve the issue.
This turned out to be a little tricky as we can't always iterate over innerBlocksafter processing elements for a particular block, in case the inner blocks are meant to come before the elements of the block. An example of this is the Quote block, where the citation appears after the inner blocks.
I've put up a tentative PR over in #52676 that seeks to fix it by looking for RawHTML as the flag to loop over inner blocks, as useInnerBlocksProps outputs inner blocks markup within a RawHTML component. It's an imperfect fix as there could conceivably be blocks that intentionally use both useInnerBlocksPropsandRawHTML, but so far, I think the results are better than what we have on trunk. I've pinged a few folks for review on that PR. I'm very happy to throw it out if there are better ideas for how to fix it!
Activity
ndiego commentedon Jul 14, 2023
I can confirm, @ellatrix any ideas?
andrewserong commentedon Jul 17, 2023
From a little digging, I think this issue might have been introduced in #52241 as it appears to only recurse into nested blocks that use
InnerBlocks.Content(the Group block doesn't). We could try tweaking the logic slightly so that it always looks at theinnerBlocksarray instead? I might give that a try so that we have something to play with / test and see if that helps resolve the issue.andrewserong commentedon Jul 17, 2023
This turned out to be a little tricky as we can't always iterate over
innerBlocksafter processing elements for a particular block, in case the inner blocks are meant to come before the elements of the block. An example of this is the Quote block, where the citation appears after the inner blocks.I've put up a tentative PR over in #52676 that seeks to fix it by looking for
RawHTMLas the flag to loop over inner blocks, asuseInnerBlocksPropsoutputs inner blocks markup within aRawHTMLcomponent. It's an imperfect fix as there could conceivably be blocks that intentionally use bothuseInnerBlocksPropsandRawHTML, but so far, I think the results are better than what we have on trunk. I've pinged a few folks for review on that PR. I'm very happy to throw it out if there are better ideas for how to fix it!