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.

Imported MDX breaks on empty lines

See original GitHub issue

Given MDX like:

# Title for this section

Paragraph of text #1...

Paragraph of text #2...

If I use this code directly in the content/pages folder, it displays as expected. But if I move the code to content/blocks/example.mdx and use <Block src="example" /> on a page, then all that displays is the first line of MDX (the # Title for this section). All of the subsequent text is getting chopped off without any error or message why. Same thing happens if you import the file.

Not sure if this is a greater issue with gatsby-plugin-mdx or not, but I would have expected this to work. Otherwise awesome library though!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shadcncommented, Jul 1, 2020

Found a fix. I’ll tag a new release. As a temporary fix you can wrap the markdown in a Div:

<Div>

# Title for this section

Paragraph of text #1...

Paragraph of text #2...

</Div>
0reactions
markmctamneycommented, Jul 7, 2020

Yep! All good, everything working as expected now. Thanks a bunch for the quick fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two blank lines within a fenced code block terminates ordered list ...
Fenced code blocks within a number bullet point break if they contain more one new-line in a row. Your environment. OS: macOS Mojave...
Read more >
Troubleshooting MDX
If there is a closing brace somewhere, make sure that the braces are each on their own lines with no text before the...
Read more >
Guide to Writing MDX and Markdown | Chicago Docs
Guide to the syntax of MDX and Markdown. ... To ensure proper rendering, add a blank line above and below the Markdown text,...
Read more >
Blogging with Gatsby & MDX - React Training
MDX is a superset of Markdown that lets you import and render React components! Check it out: import CustomComponent from '.
Read more >
MDX and React - Docusaurus
This feature is experimental and might be subject to breaking API changes in the future. Importing Markdown​. You can use Markdown files as ......
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