Supported languages

edit

Highlight and TryHighlight take the identifier of a language or one of its aliases. They are case-insensitive. IsSupported checks an identifier, and GetSupportedLanguages returns every identifier and alias, in ordinal order:

// Identifiers and aliases are case-insensitive
Assert.True(SyntaxHighlighter.IsSupported("C#"));
Assert.True(SyntaxHighlighter.IsSupported("cs"));
Assert.False(SyntaxHighlighter.IsSupported("not-a-language"));

var languages = SyntaxHighlighter.GetSupportedLanguages();
Assert.Contains("csharp", languages);

Languages

LanguageIdentifier and aliases
Apache configurationapache, apacheconf, htaccess
Arduinoarduino, ino
ARM assemblyarmasm, arm
AsciiDocasciidoc, adoc
Awkawk, gawk, mawk, nawk
Bashbash, sh, zsh, ksh
Bicepbicep, bicepparam
BNFbnf
Cc, h
Clojureclojure, clj, edn
Clojure REPLclojure-repl
CMakecmake, cmake.in
CoffeeScriptcoffeescript, coffee, cson, iced
C++cpp, c++, cc, h++, hpp, hh, hxx, cxx
Crystalcrystal, cr
C#csharp, cs, c#
CSScss
Dd
Dartdart
Delphidelphi, dpr, dfm, pas, pascal
Diffdiff, patch
Djangodjango, jinja, jinja2, j2
DNS zone filedns, bind, zone
Dockerfiledockerfile, docker
Batch filedos, bat, cmd
Elixirelixir, ex, exs
Elmelm
ERBerb
Erlangerlang, erl
Erlang REPLerlang-repl
Fortranfortran, f90, f95, f03, f08, f77, for, f
F#fsharp, fs, f#
Gherkingherkin, feature
GLSLglsl, vert, frag
Gogo, golang
GraphQLgraphql, gql
Groovygroovy, gradle
Hamlhaml
Handlebarshandlebars, hbs, html.hbs, html.handlebars, htmlbars, mustache
Haskellhaskell, hs
HCLhcl, terraform, tf, tfvars
HTMLhtml, htm, xhtml
HTTPhttp, https
INIini, gitconfig
Javajava, jsp
JavaScriptjavascript, js, jsx, mjs, cjs
JSONjson, jsonc
Juliajulia, jl
Julia REPLjulia-repl, jldoctest
Kotlinkotlin, kt, kts
KQLkql, kusto
LaTeXlatex, tex
Lessless
Lisplisp, elisp, emacs-lisp, common-lisp
LLVM IRllvm, ll
Lualua, pluto
Makefilemakefile, mk, mak, make
Markdownmarkdown, md, mkdown, mkd
MATLABmatlab
Mermaidmermaid, mmd
MSILmsil, il, cil
Nginxnginx, nginxconf
Nimnim, nims
Nixnix, nixos
Node.js REPLnode-repl
Objective-Cobjectivec, mm, objc, obj-c, obj-c++, objective-c++
OCamlocaml, ml
Perlperl, pl, pm
PostgreSQLpgsql, postgres, postgresql
PHPphp
Plain textplaintext, text, txt
PowerShellpowershell, pwsh, ps, ps1
Prologprolog
Propertiesproperties
Protocol Buffersprotobuf, proto
Puppetpuppet, pp
Pythonpython, py, gyp, ipython
Python REPLpython-repl, pycon
Rr
Razorrazor, cshtml, cshtml-razor
Rubyruby, rb, gemspec, podspec, thor, irb
Rustrust, rs
Scalascala
Schemescheme, scm
SCSSscss
Shell sessionshell, console, shellsession
Soliditysolidity, sol
SQLsql
Sveltesvelte
Swiftswift
Tcltcl, tk
Thriftthrift
TOMLtoml
Twigtwig, craftcms
TypeScripttypescript, ts, tsx, mts, cts
URL-encoded formurlencoded, x-www-form-urlencoded
VB.NETvbnet, vb
VBScriptvbscript, vbs
VBScript in HTMLvbscript-html
Verilogverilog, v, sv, svh
VHDLvhdl, vhd
Vim scriptvim, vimscript
Vuevue
WebAssembly textwasm, wat, wast
x86 assemblyx86asm
XMLxml, xsd, xsl, plist, rss, atom, svg
YAMLyaml, yml
Zigzig, zon

ml is OCaml, and gradle is Groovy.

Language identifiers from Markdown

The identifiers are the names commonly written after the opening fence of a Markdown code block, such as csharp or ts, so you can pass that name as is. It comes from the author of the document: use TryHighlight and render the code as plain text when the language is not supported. See Untrusted input.