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

Markdown Footnotes Not Properly Numbered #4647

Closed
ben-qnimble opened this issue Apr 20, 2021 · 1 comment
Closed

Markdown Footnotes Not Properly Numbered #4647

ben-qnimble opened this issue Apr 20, 2021 · 1 comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.

Comments

@ben-qnimble
Copy link
Contributor

🐛 Bug Report

I can't find documentation on the Docusaurus website, but according to https://www.markdownguide.org/tools/docusaurus/, Docusaurus uses the Remarkable markdown processor. And that processor supports footnotes, as shown in their manual and also in the The Markdown Guide

Both guides have an example for using footnotes:

Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

which yield two footnotes, 1 and 2. Where the markdown processor handles the numbering of the footnotes.

However, if you put the same code into Docusaurus, the footnotes section as expected -- labels are 1 and 2 respectively. But the superscript text with the link uses not the foot note number, but the text in between the [ ] when defining the foot note. I believe the expected behavior would be for the footnote label in the main section and the footnote section to match and both be the footnote number.

As you can see in the image below, the link to the second footnote has the text 'bignote' instead of '2' even though it links to the footnote that is labelled '2'.

image
shows the issue.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Create markdown page with

Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

Expected behavior

Second footnote in superscript should be labelled '2' and not 'bignote'

Actual Behavior

See above.

Your Environment

Clean fresh docusaurus checkout with alpha73

@ben-qnimble ben-qnimble added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 20, 2021
@slorber
Copy link
Collaborator

slorber commented Apr 20, 2021

Hi,

We use MDX, and you can test your md syntax in the MDX playground here: https://mdxjs.com/playground/

image

It seems that this behavior is from MDX, so I believe you should report it here if it is for you the wrong behavior to have.

You can also track this issue in case you'd like to use a non-MDX parser once we support alternative parsers: #3018

@slorber slorber closed this as completed Apr 20, 2021
@Josh-Cena Josh-Cena added external This issue is caused by an external dependency and not Docusaurus. and removed status: needs triage This issue has not been triaged by maintainers labels Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

3 participants