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 reversed when referenced in a table #1638

Closed
xgfd opened this issue Sep 10, 2021 · 2 comments
Closed

Footnotes reversed when referenced in a table #1638

xgfd opened this issue Sep 10, 2021 · 2 comments
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem

Comments

@xgfd
Copy link

xgfd commented Sep 10, 2021

Footnotes displayed in reverse order when referenced in a table

I have the following markdown that has 3 footnotes in a table:

|title|
|---  |
|[^1] |
|[^2] |
|[^3] |

[^1]: footnote 1
[^2]: footnote 2
[^3]: footnote 3

The MDX playground renders the footnotes in reverse order (i.e. footnote 3, footnote 2, footnote 1 instead of footnote 1, footnote 2, footnote 3).

Screenshot 2021-09-10 at 21 18 03

I also tried referencing footnote outside a table and they are rendered correctly.

Screenshot 2021-09-10 at 21 19 22

Your environment

Steps to reproduce

Past the following markdown into https://mdxjs.com/playground/

|title|
|---  |
|[^1] |
|[^2] |
|[^3] |

[^1]: footnote 1
[^2]: footnote 2
[^3]: footnote 3

Expected behaviour

The footnotes should be rendered as

  1. footnote 1
  2. footnote 2
  3. footnote 3

Actual behaviour

They rendered as

  1. footnote 3
  2. footnote 2
  3. footnote 1
@wooorm
Copy link
Member

wooorm commented Sep 12, 2021

Nice catch, thanks for the report! I fixed in in the downstream package

@xgfd
Copy link
Author

xgfd commented Sep 13, 2021

Thank you. That's a really prompt fix!

@wooorm wooorm added the 🙉 open/needs-info This needs some more info label Dec 24, 2021
wooorm added a commit to syntax-tree/mdast-util-to-hast that referenced this issue Jan 22, 2022
@wooorm wooorm added 💪 phase/solved Post is done and removed 🙉 open/needs-info This needs some more info labels Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants