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

fix(v1): fix JSX highlighting by passing language to Prism #2196

Merged
merged 3 commits into from
Jan 7, 2020

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Jan 7, 2020

The JSX highlighting is subtly broken:

Screen Shot 2020-01-07 at 4 19 30 PM

Notice how plain text in JSX gets incorrectly highlighted.

This was fixed in PrismJS/prism#1357 but I couldn't get the fix to work at all. Then I noticed we're not passing the documented third argument to Prism, so it doesn't actually use the JSX language for tokenization.

This PR fixes it.

@gaearon gaearon requested a review from endiliey as a code owner January 7, 2020 16:29
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 7, 2020
@yangshun yangshun changed the title Fix JSX highlighting by passing language to Prism fix(v1): fix JSX highlighting by passing language to Prism Jan 7, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 2532f61

https://deploy-preview-2196--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 62b913c

https://deploy-preview-2196--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally that this works and it also fixes the rendering issue here as well.

Thanks @gaearon!

@yangshun yangshun merged commit 632e2dc into facebook:master Jan 7, 2020
@gaearon gaearon deleted the patch-1 branch January 7, 2020 16:54
@yangshun yangshun added the pr: bug fix This PR fixes a bug in a past release. label Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants