What syntax highlighter is GitHub using on their site to display the code when you click on the file names?
We use Linguist to perform language detection and to select third-party grammars for syntax highlighting.
It doesn't do syntax highlighting, it only detects the language, I explored the repository alot. The grammars specify the text-mate scopes, which are not used by the linguist.
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
You can also create a Markdown hyperlink by highlighting the text and using the keyboard shortcut Command + V . If you'd like to replace the text with the link, use the keyboard shortcut Command + Shift + V .
GitHub uses tree-sitter grammars for syntax highlighting the following languages: CSS, Go, JavaScript, EJS, ERB, HTML, Python, Ruby, TypeScript and CodeQL. The JavaScript tree-sitter grammar is here: https://github.com/tree-sitter/tree-sitter-javascript
Source: https://github.com/github/linguist/discussions/5572#discussioncomment-1355712
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With