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 in tables rendered out of order #6625

Closed
5 of 7 tasks
LeviticusMB opened this issue Feb 6, 2022 · 6 comments
Closed
5 of 7 tasks

Footnotes in tables rendered out of order #6625

LeviticusMB opened this issue Feb 6, 2022 · 6 comments
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

@LeviticusMB
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When footnote references appears inside tables, the order and numbering does not match what's intended.

I tried the code below in https://mdxjs.com/playground/, as suggested in a comment of #4647, but over there the rendered output is correct.

Steps to reproduce

I have the following code in one of my pages:

Format        | Main Media Type                     | Parser
--------------|-------------------------------------|------------------
HTML forms    | `application/x-www-form-urlencoded` | [FormParser]
MIME messages | `message/*`[^1]                     | [MessageParser]
Text          | `multipart/*`[^2]                   | [MultiPartParser]

[^1]: This parser is primary for `message/rfc822` (E-mail) messages, but can actually handle most other `message`
      subtypes too (not `message/http`, though).
[^2]: This parser handles MIME multi-part messages as well as `multipart/form-data`, used by web forms.

[FormParser]:      ../api/classes/divine_uri.FormParser.md
[MessageParser]:   ../api/classes/divine_uri.MessageParser.md
[MultiPartParser]: ../api/classes/divine_uri.MultiPartParser.md

Expected behavior

Format Main Media Type Parser
HTML forms application/x-www-form-urlencoded FormParser
MIME messages message/*[1] MessageParser
Text multipart/*[2] MultiPartParser
  1. This parser is primary for message/rfc822 (E-mail) messages, but can actually handle most other message subtypes too (not message/http, though).
  2. This parser handles MIME multi-part messages as well as multipart/form-data, used by web forms.

Actual behavior

Format Main Media Type Parser
HTML forms application/x-www-form-urlencoded FormParser
MIME messages message/*[1] MessageParser
Text multipart/*[2] MultiPartParser
  1. This parser handles MIME multi-part messages as well as multipart/form-data, used by web forms.
  2. This parser is primary for message/rfc822 (E-mail) messages, but can actually handle most other message subtypes too (not message/http, though).

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.
@LeviticusMB LeviticusMB 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 Feb 6, 2022
@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 7, 2022
@Josh-Cena
Copy link
Collaborator

Hi! I've already reported it here: remarkjs/remark-gfm#35

Unfortunately, the fix will only be applied in the latest version of Remark/MDX, which is not compatible with Docusuarus v2 (see #4029 and #3668). In the meantime, you would have to manually reorder it yourself, or find a way that doesn't put the footnotes in the table.

@LeviticusMB
Copy link
Contributor Author

Not totally happy with this answer, I forked the last cjs version of the module and am now using "mdast-util-to-hast": "Divine-Software/mdast-util-to-hast#0e709bd254f07bad424d74a1d98e727d1d7926e4" as an override. Docusuarus v3 must be years away? Can't wait for that.

Anyway, problem solved. Thanks for the direction to where the bug was.

@Josh-Cena
Copy link
Collaborator

Docusaurus v3 is planned immediately after v2. See #6113 and the 3.0 milestone for things we plan to do. In the future, because we will be sticking to semver conventions, major version bumps are going to happen much more frequently.

chmanie added a commit to JoinColony/docs that referenced this issue Dec 1, 2022
This can be reverted as soon as docusaurus v3 is out.
See here for more info: facebook/docusaurus#6625
@amacneil
Copy link

Any update on this? Still seems to be an issue in v2.4.1, despite #4029 being complete.

amacneil added a commit to foxglove/mcap that referenced this issue May 22, 2023
@Josh-Cena
Copy link
Collaborator

@amacneil #4029 is for Docusaurus 3. You would need to use the canary version to try it.

@amacneil
Copy link

I see, thanks. Will wait for official release.

For now I worked around it by using <sup>1</sup> and creating manual footnotes.

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