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

@mdx-js/runtime: Empty line causes error #246

Closed
dekryptic opened this issue Aug 31, 2018 · 2 comments
Closed

@mdx-js/runtime: Empty line causes error #246

dekryptic opened this issue Aug 31, 2018 · 2 comments
Labels
🐛 type/bug This is a problem

Comments

@dekryptic
Copy link

dekryptic commented Aug 31, 2018

Example: https://codesandbox.io/s/x913608y8o

If you remove the empty line @ 20, everything works.

Not sure if maybe I'm missing something here.

Edit: Also seems to throw an error if <h2 style={{"textAlign":"right"}}>On the right</h2> is directly after ### Hi instead of <Rand />.

@silvenon silvenon added the 🐛 type/bug This is a problem label Sep 4, 2018
@silvenon
Copy link
Contributor

silvenon commented Sep 17, 2018

Just to narrow the bug down for anyone curious to solve it. This MDX:

<div style={{ color: 'tomato' }} />

compiles normally. However, if I change the tag to (apparently) any of the tags natively supported by Markdown:

<p style={{ color: 'tomato' }} />

it compiles to this:

<MDXTag
  name="p"
  components={components}
>
  {`<p style={{ color: 'tomato' }} />`}
</MDXTag>

This is the root of the problem. The syntax error happens as soon as you add children to that paragraph. It's a bug in @mdx-js/mdx, not runtime.

Probably the same problem as #222.

@johno
Copy link
Member

johno commented Feb 15, 2019

Thanks for opening up the issue! I'm going to close this in favor of #195 since it covers the same parsing issue.

@johno johno closed this as completed Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug This is a problem
Development

No branches or pull requests

3 participants