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

Issue With Self-closing Tags In JSX and <br> In Markdown Content #56

Closed
alexfinnarn opened this issue Jun 24, 2019 · 3 comments
Closed
Labels
bug: medium import A medium article isn't imported correctly

Comments

@alexfinnarn
Copy link
Contributor

alexfinnarn commented Jun 24, 2019

Describe the bug

I had a bulleted list that used the <br> tag in a sentence, and I got an error while Gatsby compiled. Locally, my blog still finished compiling, but on Netlify it just stopped half-way.

Once I wrapped the line break tag in ticks, <br>, my issue went away.

Expected behavior
A clear and concise description of what you expected to happen.

  • What's the URL of the Medium article it is failing to parse?
  • What part of the article isn't parsed correctly?

alexfinnarn/blog@43e0192#diff-5af09c7cd8da7647ae9977eaa530290dR32

"table with
,"

Screenshots
Screen Shot 2019-06-23 at 7 50 08 PM

@alexfinnarn alexfinnarn added the bug: medium import A medium article isn't imported correctly label Jun 24, 2019
@alexfinnarn alexfinnarn changed the title No Likey <br> In Content Issue With Self-closing Tags and <br> In Content Jul 5, 2019
@alexfinnarn alexfinnarn changed the title Issue With Self-closing Tags and <br> In Content Issue With Self-closing Tags In JSX and <br> In Markdown Content Jul 5, 2019
@alexfinnarn
Copy link
Contributor Author

I'm still learning more about React, but I think this is a JSX/MDX problem with self-closing tags. To test, I'd have to try <br /> and see if that fixes the parsing error.

@mathieudutour
Copy link
Owner

indeed, MDX uses a mix of markdown and JSX to render content so if you use <br>, it assumes you meant a JSX element and can't find the closing one so it throws an error.

It works locally but if you go to the article, it should break as well (because it's compiled just in time)

@alexfinnarn
Copy link
Contributor Author

Made a PR for this to add to readme. I think you should merge that in or close the issue. This thread should be good enough for people to get some idea on how to resolve if they encounter the issue.

mathieudutour added a commit that referenced this issue Mar 15, 2020
Issues #56 and #54: Troubleshooting Info For JSX and Authentication Errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: medium import A medium article isn't imported correctly
Projects
None yet
Development

No branches or pull requests

2 participants