-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(jsx) bug with parsing closing tags #931
Comments
@gaearon what language is this? |
JSX, being parsed as JavaScript. I'm not sure if you aim to support it but there have been other tickets (#494, #766, #767) so I assumed you do. For an example of good JSX support, you can look at Prism. Even when Highlight.js parses JSX, it still renders it strangely: Compare this to Prism: Granted, Prism has a special JSX mode. |
I switched to Prism so feel free to close if it's not a priority. |
It would be nice to parse jsx correctly for reveal.js-slides. |
It's part of JSX. Please see |
Got it. Thanks! |
Looks like we can't simply really reuse the XML parser for JSX because of templating and having arbitrary JavaScript within it. A solution I can see right now is to implement a dedicated JSX grammar borrowing as many definitions as possible from XML to reduce duplication. I won't be able to get to it myself for some time (I'm re-implementing the core in #1140) so if anyone feels adventurous enough, assign the issue to yourself, and I'll give more details on how this might be done. Shouldn't be hard, actually. |
It's 2017, is JSX support still not here? |
Still not working, using the default highlight.js plugin inside a Gitbook: Switching to Prism fixes it: |
Has there been any progress? Visual Studio Code uses highlight.js to format source code in Markdown documents. Each time I use a collapsed JSX element in my documentation, the preview breaks. See microsoft/vscode#60015. |
@DanielSWolf sorry, no: there is no one maintaining the languages themselves (see #1678). We are trying to find people in the community to take over ownership of the languages. |
That's too bad. Thanks for the update, though! |
Sorry I can't be of more help - if you have spare cycles and it's bother you enough, maybe you can take a look? All PRs welcome, though I also appreciate everyone is super busy. |
From what I can tell this is a duplication of #1915 ? Does that seem right? Anyone still here? It's all about us not supporting closing tags properly I think. |
Closing due to inactivity. Determination: Duplication of #1915 as mentioned above. If this doesn't seem correct someone please let me know and we can always reopen. :) |
Here's the code snippet that doesn't get highlighted at all:
I can reproduce this with 8.8.0.
Removing the JSX part makes the highlighting work again.
The text was updated successfully, but these errors were encountered: