-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Inline comment directly after jsx block fails to parse. #784
Comments
Successful parse: <!-- Comment -->
<Component/> <Component/>
<!-- Comment --> Failure: <Component/>
<!-- Comment --> <!-- Comment --><Component/> <Component/><!-- Comment --> |
Heya, I’m working on a replacement for the current JSX parsing to solve many of the outstanding issues, like this one. I have one Q about this: why should |
@wooorm Good question. I reckon MD doesn't have a syntax for comments, so we were left with HTML comment. Nor does JSX have comments, really. I'm not sure about
But I reckon that, if we, in fact, stop treating HTML as a valid MDX, in favour of JSX as a valid MDX, then yes, indeed JS comment in JSX syntax is more "proper" than HTML comment, yes. (just not sure whether we do xd) |
Just circling back to report that the next branch supports my earlier idea, and you don’t need fragments, this works:
Which is one character less than HTML comments! |
Hi all! I’m going to close this as it landed on the The reason is so that it’s more clear which issues still need to be solved already and don’t require further work. Expect another For more info, see #1041. |
Subject of the issue
Adding an inline md comment directly after an inline html/jsx block in a markdown file causes mdx to fail to parse.
Similar to this issue: #243
Your environment
Steps to reproduce
ON the sample site, add an inline comment to the in html example.
🎉 BONUS POINTS for creating a minimal reproduction and uploading it to GitHub. This will get you the fastest support. 🎉
Expected behaviour
The comment is ignored.
Actual behaviour
Parsing fails.
The text was updated successfully, but these errors were encountered: