Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

JSX Components do not work in the middle of Markdown elements #368

Closed
adueck opened this issue Apr 18, 2019 · 1 comment
Closed

JSX Components do not work in the middle of Markdown elements #368

adueck opened this issue Apr 18, 2019 · 1 comment

Comments

@adueck
Copy link

adueck commented Apr 18, 2019

Describe the bug
JSX Components will only render when on their own line. If placed in the middle of, say, a paragraph of markdown text, they either break the page build or are rendered as literal text.

I wasn't sure if this was a limitation in mdx itself so I asked this question, and they confirmed that this should work with version 1 of mdx.

See my snippet from the question here and this snippet below provided by the mdx people. Neither of these work for me with gatsby-mdx.

56370643-d19b3f80-61b8-11e9-880f-7154e97d67aa

With gatsby-mdx:

## My mdx file  

The JSX here <span style={{ backgroundColor: "red" }}>breaks the build</span>. Ouch.  

<span style={{ backgroundColor: "red" }}>But on a seperate line it's ok</span>  

mdx version 1 should support both spans...

gatsby-mdx only supports the second one. 
@adueck
Copy link
Author

adueck commented Apr 18, 2019

Oops! I just realized that the gatsby-starter-mdx-basic that I cloned a while back just updated to use v1 of mdx. I didn't realize I was using the older one. Sorry!

@adueck adueck closed this as completed Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant