Skip to content

add Support for converting footnotes markdown into block #70635

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

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

USERSATOSHI
Copy link
Contributor

@USERSATOSHI USERSATOSHI commented Jul 7, 2025

What?

Closes #57152
Depends on: #70615

This PR adds support to convert footnotes in markdown to footnotes block.

Why?

Right now, When pasting markdown containing footnotes, the footnotes are not converted into footnotes block by showdown.

How?

This PR adds that support by extending showdown to parse footnotes in markdown to html and lets gutenberg's htmlToBlock function handle the conversion with added support for updating the meta of that post.

This adds supports for raw transform in footnotes, updating htmlToBlocks to take account for footnotes content and extend showdown package to add footnotes parser.

Testing Instructions

  1. Open a post or page.
  2. Copy the following markdown
This is a statement that needs a citation.[^1] And here’s another interesting fact.[^2]

More content here. You can keep writing as usual.

[^1]: This is the first footnote. You can include a link or detailed explanation here.
[^2]: This is the second footnote. Additional info goes here.
  1. Paste the content in the post
  2. See footnotes block being generated from markdown.

Screenshots or screencast

Screen.Recording.2025-07-08.at.12.03.54.AM.mov

@USERSATOSHI USERSATOSHI marked this pull request as ready for review July 8, 2025 09:36
Copy link

github-actions bot commented Jul 8, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: USERSATOSHI <[email protected]>
Co-authored-by: zdenys <[email protected]>
Co-authored-by: audunmb <[email protected]>
Co-authored-by: stronenv <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Feature] Paste [Block] Footnotes Affects the Footnotes Block labels Jul 8, 2025
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 [Feature] Paste [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Footnotes not recognized in pasted markdown
2 participants