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

Lack of newlines inside components break markdown parsing #1563

Closed
alvarlagerlof opened this issue May 25, 2021 · 2 comments
Closed

Lack of newlines inside components break markdown parsing #1563

alvarlagerlof opened this issue May 25, 2021 · 2 comments
Labels
👯 no/duplicate Déjà vu 🙋 no/question This does not need any changes

Comments

@alvarlagerlof
Copy link

Lack of newlines inside components break markdown parsing

When using markdown inside a react component that simply outputs its children wrapped in anything (a section, div) the markdown is not converted to the appropriate component.

Your environment

  • OS: Fedora 34
  • Packages: @mdx-js/loader 1.6.22, @next/mdx 10.2.0, next 10.1.3, react 17.0.2
  • Env: Node 14.15.4, yarn 1.22.10, Brave 1.24.86

Steps to reproduce

This works as expected

<Header>

# Title

Text

</Header>

This does not

<Header>
# Title

Text

</Header>

It is also worth noting that placing a space on the empty line about the title also breaks the code in the same way

Expected behaviour

image

Actual behaviour

image

@alvarlagerlof alvarlagerlof added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels May 25, 2021
@alvarlagerlof
Copy link
Author

If there is a good reason for it needing to be this way, I feel like it should be documented early on the website at least.

@ChristianMurphy
Copy link
Member

ChristianMurphy commented May 25, 2021

duplicate of #1312 and #1424, this is how MDX 1 works.
This behavior is changed in version 2 as part of #628 you can find more information on the beta here: #1041
improvements to documentation are welcome!

@ChristianMurphy ChristianMurphy added 👯 no/duplicate Déjà vu 🙋 no/question This does not need any changes and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants