question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiline footnotes broken in 1.6.1

See original GitHub issue

Subject 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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danedencommented, Jun 7, 2020

Came here to +1! Reproducible on my site as well.

1reaction
Eyascommented, May 2, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found