- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Fix syntax highlighting. #73
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
Conversation
          🦋 Changeset detectedLatest commit: e29b46b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
 Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR  | 
    
          ✅ Deploy Preview for react-github-permalink ready!
 To edit notification comments on pull requests, go to your Netlify project configuration.  | 
    
Fix syntax highlighting for React/TypeScript files by adding language detection Co-authored-by: dwjohnston <[email protected]> Add React TSX syntax highlighting demo story and verify fix works Co-authored-by: dwjohnston <[email protected]> Sample tsx Just don't set the language Get rid of 'getLanguageFromPath' stuff
3355328    to
    e53808d      
    Compare
  
    
          ✅ Deploy Preview for react-github-permalink ready!
 To edit notification comments on pull requests, go to your Netlify project configuration.  | 
    
… detection Co-authored-by: dwjohnston <[email protected]>
7337d25    to
    48dfb21      
    Compare
  
    
Fix syntax highlighting issue by auto detecting language based on file extension.
This is a somewhat naive approach, but works for now.
Also, have switched to Prism of HLJS as Prism supports TSX, JSX.
Worth considering approaches mentioned in this thread for more comprehensive language detection.
PrismJS/prism#1313