Skip to main content
added 15 characters in body
Source Link
Artur Meinild
  • 29.4k
  • 8
  • 24

Note that lang-plaintext or lang-none explicitly disables syntax highlighting.

Quote from post edited 30 Aug, 2022.

Language codes currently available on Stack Exchange

This is a complete list of every identifier that you can use in a language hint for syntax highlighting. All the language identifiers in each group point to the same highlighter. Other language aliases set by highlight.js (in brackets) should work, but only identifiers before them are officially supported by Stack Exchange.

Format: Language name: lang-code, custom Stack Exchange aliases, (other Highlight.js aliases)

  • Plain text: lang-plaintext, lang-none, (lang-text, lang-txt) (explicitly disables syntax highlighting)
  • Bash and other shell scripts: lang-bash, lang-bsh, lang-csh, lang-sh
  • C and C-likes: lang-c, lang-cyc, lang-m, lang-c-like, (lang-h)
  • Clojure: lang-clojure, lang-clj
  • CoffeeScript: lang-coffeescript, lang-coffee, (lang-cson, lang-iced)
  • C++: lang-cpp, lang-cc, lang-cxx, (lang-c++, lang-h++, lang-hpp, lang-hh, lang-hxx)
  • C#: lang-csharp, lang-cs, (lang-c#)
  • CSS: lang-css
  • Dart: lang-dart
  • Delphi, Pascal: lang-delphi, (lang-dpr, lang-dfm, lang-pas, lang-pascal)
  • Erlang: lang-erlang, lang-erl
  • Go: lang-go, (lang-golang)
  • Haskell: lang-haskell, lang-hs
  • HTTP request/​response: lang-http, (lang-https)
  • INI, TOML: lang-ini, (lang-toml)
  • Java: lang-java, (lang-jsp)
  • JavaScript: lang-javascript, lang-js, (lang-jsx, lang-mjs, lang-cjs)
  • JSON: lang-json
  • Kotlin: lang-kotlin, (lang-kt, lang-kts)
  • LaTeX, TeX: lang-latex, lang-tex
  • Less: lang-less
  • Lisp: lang-lisp, lang-cl, lang-el, lang-lsp
  • Lua: lang-lua
  • Makefile: lang-makefile, (lang-mk, lang-mak, lang-make)
  • Markdown: lang-markdown, (lang-md, lang-mkdown, lang-mkd)
  • Mathematica / Wolfram Language: lang-mathematica, lang-mma, (lang-wl) (Mathematica SE only)
  • MATLAB: lang-matlab
  • Objective-C: lang-objectivec, (lang-mm, lang-objc, lang-obj-c, lang-obj-c++, lang-objective-c++)
  • OCaml, F#, SML and other ML-family languages: lang-ocaml, lang-fs, lang-ml
  • Perl: lang-perl, lang-pl, (lang-pm)
  • PHP: lang-php
  • PHP template (HTML+PHP): lang-php-template
  • Protocol Buffers: lang-protobuf
  • Python: lang-python, lang-py, lang-cv, (lang-gyp, lang-ipython)
  • R, S: lang-r, lang-s
  • Ruby: lang-ruby, lang-rb, (lang-gemspec, lang-podspec, lang-thor, lang-irb)
  • Rust: lang-rust, lang-rc, lang-rs
  • Scala: lang-scala
  • Scheme, Racket: lang-scheme, lang-scm, lang-ss, lang-rkt
  • SCSS: lang-scss
  • Shell session: lang-shell, (lang-console, lang-shellsession)
  • SQL: lang-sql
  • Swift: lang-swift
  • TypeScript: lang-typescript, (lang-ts, lang-tsx)
  • Visual Basic (.NET), VBScript: lang-vbnet, lang-vb, lang-vbs
  • VHDL: lang-vhdl, lang-vhd
  • XML, HTML and their derivatives: lang-xml, lang-html, lang-xsl, (lang-xhtml, lang-rss, lang-atom, lang-xjb, lang-xsd, lang-plist, lang-wsf, lang-svg)
  • YAML: lang-yaml, (lang-yml)

Note that lang-plaintext explicitly disables syntax highlighting.

Language codes currently available on Stack Exchange

This is a complete list of every identifier that you can use in a language hint for syntax highlighting. All the language identifiers in each group point to the same highlighter. Other language aliases set by highlight.js (in brackets) should work, but only identifiers before them are officially supported by Stack Exchange.

Format: Language name: lang-code, custom Stack Exchange aliases, (other Highlight.js aliases)

  • Plain text: lang-plaintext, lang-none, (lang-text, lang-txt) (explicitly disables syntax highlighting)
  • Bash and other shell scripts: lang-bash, lang-bsh, lang-csh, lang-sh
  • C and C-likes: lang-c, lang-cyc, lang-m, lang-c-like, (lang-h)
  • Clojure: lang-clojure, lang-clj
  • CoffeeScript: lang-coffeescript, lang-coffee, (lang-cson, lang-iced)
  • C++: lang-cpp, lang-cc, lang-cxx, (lang-c++, lang-h++, lang-hpp, lang-hh, lang-hxx)
  • C#: lang-csharp, lang-cs, (lang-c#)
  • CSS: lang-css
  • Dart: lang-dart
  • Delphi, Pascal: lang-delphi, (lang-dpr, lang-dfm, lang-pas, lang-pascal)
  • Erlang: lang-erlang, lang-erl
  • Go: lang-go, (lang-golang)
  • Haskell: lang-haskell, lang-hs
  • HTTP request/​response: lang-http, (lang-https)
  • INI, TOML: lang-ini, (lang-toml)
  • Java: lang-java, (lang-jsp)
  • JavaScript: lang-javascript, lang-js, (lang-jsx, lang-mjs, lang-cjs)
  • JSON: lang-json
  • Kotlin: lang-kotlin, (lang-kt, lang-kts)
  • LaTeX, TeX: lang-latex, lang-tex
  • Less: lang-less
  • Lisp: lang-lisp, lang-cl, lang-el, lang-lsp
  • Lua: lang-lua
  • Makefile: lang-makefile, (lang-mk, lang-mak, lang-make)
  • Markdown: lang-markdown, (lang-md, lang-mkdown, lang-mkd)
  • Mathematica / Wolfram Language: lang-mathematica, lang-mma, (lang-wl) (Mathematica SE only)
  • MATLAB: lang-matlab
  • Objective-C: lang-objectivec, (lang-mm, lang-objc, lang-obj-c, lang-obj-c++, lang-objective-c++)
  • OCaml, F#, SML and other ML-family languages: lang-ocaml, lang-fs, lang-ml
  • Perl: lang-perl, lang-pl, (lang-pm)
  • PHP: lang-php
  • PHP template (HTML+PHP): lang-php-template
  • Protocol Buffers: lang-protobuf
  • Python: lang-python, lang-py, lang-cv, (lang-gyp, lang-ipython)
  • R, S: lang-r, lang-s
  • Ruby: lang-ruby, lang-rb, (lang-gemspec, lang-podspec, lang-thor, lang-irb)
  • Rust: lang-rust, lang-rc, lang-rs
  • Scala: lang-scala
  • Scheme, Racket: lang-scheme, lang-scm, lang-ss, lang-rkt
  • SCSS: lang-scss
  • Shell session: lang-shell, (lang-console, lang-shellsession)
  • SQL: lang-sql
  • Swift: lang-swift
  • TypeScript: lang-typescript, (lang-ts, lang-tsx)
  • Visual Basic (.NET), VBScript: lang-vbnet, lang-vb, lang-vbs
  • VHDL: lang-vhdl, lang-vhd
  • XML, HTML and their derivatives: lang-xml, lang-html, lang-xsl, (lang-xhtml, lang-rss, lang-atom, lang-xjb, lang-xsd, lang-plist, lang-wsf, lang-svg)
  • YAML: lang-yaml, (lang-yml)

Note that lang-plaintext or lang-none explicitly disables syntax highlighting.

Quote from post edited 30 Aug, 2022.

Language codes currently available on Stack Exchange

This is a complete list of every identifier that you can use in a language hint for syntax highlighting. All the language identifiers in each group point to the same highlighter. Other language aliases set by highlight.js (in brackets) should work, but only identifiers before them are officially supported by Stack Exchange.

Format: Language name: lang-code, custom Stack Exchange aliases, (other Highlight.js aliases)

  • Plain text: lang-plaintext, lang-none, (lang-text, lang-txt) (explicitly disables syntax highlighting)
  • Bash and other shell scripts: lang-bash, lang-bsh, lang-csh, lang-sh
  • C and C-likes: lang-c, lang-cyc, lang-m, lang-c-like, (lang-h)
  • Clojure: lang-clojure, lang-clj
  • CoffeeScript: lang-coffeescript, lang-coffee, (lang-cson, lang-iced)
  • C++: lang-cpp, lang-cc, lang-cxx, (lang-c++, lang-h++, lang-hpp, lang-hh, lang-hxx)
  • C#: lang-csharp, lang-cs, (lang-c#)
  • CSS: lang-css
  • Dart: lang-dart
  • Delphi, Pascal: lang-delphi, (lang-dpr, lang-dfm, lang-pas, lang-pascal)
  • Erlang: lang-erlang, lang-erl
  • Go: lang-go, (lang-golang)
  • Haskell: lang-haskell, lang-hs
  • HTTP request/​response: lang-http, (lang-https)
  • INI, TOML: lang-ini, (lang-toml)
  • Java: lang-java, (lang-jsp)
  • JavaScript: lang-javascript, lang-js, (lang-jsx, lang-mjs, lang-cjs)
  • JSON: lang-json
  • Kotlin: lang-kotlin, (lang-kt, lang-kts)
  • LaTeX, TeX: lang-latex, lang-tex
  • Less: lang-less
  • Lisp: lang-lisp, lang-cl, lang-el, lang-lsp
  • Lua: lang-lua
  • Makefile: lang-makefile, (lang-mk, lang-mak, lang-make)
  • Markdown: lang-markdown, (lang-md, lang-mkdown, lang-mkd)
  • Mathematica / Wolfram Language: lang-mathematica, lang-mma, (lang-wl) (Mathematica SE only)
  • MATLAB: lang-matlab
  • Objective-C: lang-objectivec, (lang-mm, lang-objc, lang-obj-c, lang-obj-c++, lang-objective-c++)
  • OCaml, F#, SML and other ML-family languages: lang-ocaml, lang-fs, lang-ml
  • Perl: lang-perl, lang-pl, (lang-pm)
  • PHP: lang-php
  • PHP template (HTML+PHP): lang-php-template
  • Protocol Buffers: lang-protobuf
  • Python: lang-python, lang-py, lang-cv, (lang-gyp, lang-ipython)
  • R, S: lang-r, lang-s
  • Ruby: lang-ruby, lang-rb, (lang-gemspec, lang-podspec, lang-thor, lang-irb)
  • Rust: lang-rust, lang-rc, lang-rs
  • Scala: lang-scala
  • Scheme, Racket: lang-scheme, lang-scm, lang-ss, lang-rkt
  • SCSS: lang-scss
  • Shell session: lang-shell, (lang-console, lang-shellsession)
  • SQL: lang-sql
  • Swift: lang-swift
  • TypeScript: lang-typescript, (lang-ts, lang-tsx)
  • Visual Basic (.NET), VBScript: lang-vbnet, lang-vb, lang-vbs
  • VHDL: lang-vhdl, lang-vhd
  • XML, HTML and their derivatives: lang-xml, lang-html, lang-xsl, (lang-xhtml, lang-rss, lang-atom, lang-xjb, lang-xsd, lang-plist, lang-wsf, lang-svg)
  • YAML: lang-yaml, (lang-yml)
Source Link
Artur Meinild
  • 29.4k
  • 8
  • 24

The answer is here: What is syntax highlighting and how does it work?

Note that lang-plaintext explicitly disables syntax highlighting.

Language codes currently available on Stack Exchange

This is a complete list of every identifier that you can use in a language hint for syntax highlighting. All the language identifiers in each group point to the same highlighter. Other language aliases set by highlight.js (in brackets) should work, but only identifiers before them are officially supported by Stack Exchange.

Format: Language name: lang-code, custom Stack Exchange aliases, (other Highlight.js aliases)

  • Plain text: lang-plaintext, lang-none, (lang-text, lang-txt) (explicitly disables syntax highlighting)
  • Bash and other shell scripts: lang-bash, lang-bsh, lang-csh, lang-sh
  • C and C-likes: lang-c, lang-cyc, lang-m, lang-c-like, (lang-h)
  • Clojure: lang-clojure, lang-clj
  • CoffeeScript: lang-coffeescript, lang-coffee, (lang-cson, lang-iced)
  • C++: lang-cpp, lang-cc, lang-cxx, (lang-c++, lang-h++, lang-hpp, lang-hh, lang-hxx)
  • C#: lang-csharp, lang-cs, (lang-c#)
  • CSS: lang-css
  • Dart: lang-dart
  • Delphi, Pascal: lang-delphi, (lang-dpr, lang-dfm, lang-pas, lang-pascal)
  • Erlang: lang-erlang, lang-erl
  • Go: lang-go, (lang-golang)
  • Haskell: lang-haskell, lang-hs
  • HTTP request/​response: lang-http, (lang-https)
  • INI, TOML: lang-ini, (lang-toml)
  • Java: lang-java, (lang-jsp)
  • JavaScript: lang-javascript, lang-js, (lang-jsx, lang-mjs, lang-cjs)
  • JSON: lang-json
  • Kotlin: lang-kotlin, (lang-kt, lang-kts)
  • LaTeX, TeX: lang-latex, lang-tex
  • Less: lang-less
  • Lisp: lang-lisp, lang-cl, lang-el, lang-lsp
  • Lua: lang-lua
  • Makefile: lang-makefile, (lang-mk, lang-mak, lang-make)
  • Markdown: lang-markdown, (lang-md, lang-mkdown, lang-mkd)
  • Mathematica / Wolfram Language: lang-mathematica, lang-mma, (lang-wl) (Mathematica SE only)
  • MATLAB: lang-matlab
  • Objective-C: lang-objectivec, (lang-mm, lang-objc, lang-obj-c, lang-obj-c++, lang-objective-c++)
  • OCaml, F#, SML and other ML-family languages: lang-ocaml, lang-fs, lang-ml
  • Perl: lang-perl, lang-pl, (lang-pm)
  • PHP: lang-php
  • PHP template (HTML+PHP): lang-php-template
  • Protocol Buffers: lang-protobuf
  • Python: lang-python, lang-py, lang-cv, (lang-gyp, lang-ipython)
  • R, S: lang-r, lang-s
  • Ruby: lang-ruby, lang-rb, (lang-gemspec, lang-podspec, lang-thor, lang-irb)
  • Rust: lang-rust, lang-rc, lang-rs
  • Scala: lang-scala
  • Scheme, Racket: lang-scheme, lang-scm, lang-ss, lang-rkt
  • SCSS: lang-scss
  • Shell session: lang-shell, (lang-console, lang-shellsession)
  • SQL: lang-sql
  • Swift: lang-swift
  • TypeScript: lang-typescript, (lang-ts, lang-tsx)
  • Visual Basic (.NET), VBScript: lang-vbnet, lang-vb, lang-vbs
  • VHDL: lang-vhdl, lang-vhd
  • XML, HTML and their derivatives: lang-xml, lang-html, lang-xsl, (lang-xhtml, lang-rss, lang-atom, lang-xjb, lang-xsd, lang-plist, lang-wsf, lang-svg)
  • YAML: lang-yaml, (lang-yml)