Multiline footnotes broken in 1.6.1
See original GitHub issueSubject of the issue
Given the Markdown:
Hey there [^1]
[^1]:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
@mdx-js/mdx@1.5.8
used to transform this into an AST where the “Lorem ipsum” paragraph is part of the footnote. @mdx-js/mdx@1.6.1
transofrms this into an empty footnote, and the paragraph is just rendered as text.
Your environment
- OS:
- Packages: @mdxjs/mdx@1.5.8 – Tried both in:
- gatsby via latest gatsby-remark-mdx, and
- fork of ast-explorer with 1.5.8 vs 1.6.1.
- old (correct) behavior can be seen in astexplorer.net
- Env:
- Tried with Yarn and NPM
Steps to reproduce
Use this markdown:
Hey there [^1]
[^1]:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
Expected behaviour
Renders “Hey there(1)” with a footnote at the bottom containing entire paragraph.
Prettier agrees and reformats footnote with very long paragraph after it into this format.
Actual behaviour
Renders:
"Hey there(1)
Lorem ipsum dolor sit amet,…
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Get text in multi-line footnotes to align - Microsoft Community
Insert a tab between the footnote # and text, together with a hanging indent and a tab-stop at the desired position for the...
Read more >Change Log - 1.62.0
Footnotes, with the [footnote This is the footnote] syntax. ... Revert xml escaping document info, it broke some documentation files (now a 1.6...
Read more >Multiline footnotes [SOLVED] - Resolved help - Obsidian Forum
The footnotes are split in the first lines and the rest is treated as regular text. I've added colored boxes to see how...
Read more >Fiery Feeds 1.0 Changelog - Cocoacake Blog
Always use white background for websites – some websites appear broken ... Removed footnote popups, full width images for performance ... Version 1.6.1....
Read more >Release Notes - CommonMark for PHP
Simplified checks for thematic breaks ... Fixed parsing of footnotes without content; Fixed rendering of orphaned footnotes and ... 1.6.1 - 2021-05-08¶.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Came here to +1! Reproducible on my site as well.
Yeah, I think it’s this. Opened remarkjs/remark-footnotes#1
remark-footnotes doesn’t like mutliline footnotes where the first line is blank. E.g. a footnote that is one long paragraph.
But mdx used to be okay with that.
I think supporting it is the right solution here, since prettier formatting will turn a long-single-paragraph footnote into the format you see above.