Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footnotes: can't add footnotes to nested blocks #52628

Closed
ramonjd opened this issue Jul 14, 2023 · 3 comments · Fixed by #52682
Closed

Footnotes: can't add footnotes to nested blocks #52628

ramonjd opened this issue Jul 14, 2023 · 3 comments · Fixed by #52682
Assignees
Labels
[Block] Footnotes Affects the Footnotes Block [Type] Bug An existing feature does not function as intended

Comments

@ramonjd
Copy link
Member

ramonjd commented Jul 14, 2023

Description

I can't seem to add footnotes to any text blocks that are nested inside, say, a Group block.

Step-by-step reproduction instructions

  1. Insert a Group block
  2. Then add a paragraph or heading inside
  3. Add a footnote to the new text block
  4. Observe that the * symbol appears and no footnote is generated

Screenshots, screen recording, code snippet

2023-07-14.15.56.41.mp4

Environment info

  • WP 6.3 Beta 4
  • GB Trunk
  • Chrome

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ndiego
Copy link
Member

ndiego commented Jul 14, 2023

I can confirm, @ellatrix any ideas?

Image

@ndiego ndiego moved this from ❓ Triage to 📥 Todo in WordPress 6.3.x Editor Tasks Jul 14, 2023
@andrewserong
Copy link
Contributor

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.

@andrewserong
Copy link
Contributor

This turned out to be a little tricky as we can't always iterate over innerBlocks after 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 useInnerBlocksProps and RawHTML, 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Footnotes Affects the Footnotes Block [Type] Bug An existing feature does not function as intended
Projects
No open projects
5 participants