You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a React file but save it with .js extension, then GitHub code highlighting breaks when it reaches a single quote in text. Saving the same file in .jsx works fine.
See example on this repo. Both file correct-highlighting.jsx and incorrect-highlighting.js have the same content. As you can, the .js has wrong syntax highlighting.
A solution is to add // vim: syntax=JSX to the top of the file, but this will get annoying really fast. Ideally, Linguist is intelligent to determine that the file is a React file and applies correct syntax.
The text was updated successfully, but these errors were encountered:
If you create a React file but save it with
.js
extension, then GitHub code highlighting breaks when it reaches a single quote in text. Saving the same file in.jsx
works fine.See example on this repo. Both file
correct-highlighting.jsx
andincorrect-highlighting.js
have the same content. As you can, the.js
has wrong syntax highlighting.A solution is to add
// vim: syntax=JSX
to the top of the file, but this will get annoying really fast. Ideally, Linguist is intelligent to determine that the file is a React file and applies correct syntax.The text was updated successfully, but these errors were encountered: