Skip to main content
Commonmark migration
Source Link

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

 

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

 

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

added 121 characters in body
Source Link
Glorfindel Mod
  • 252.6k
  • 61
  • 626
  • 1.3k

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

adding SPECIFIC examples (because I came here dozens of times, and being pointed elsewhere and to entire specs, if all I want is a quick snippet...) "Uncommented" »Available...«, otherweise the 2 quote boxes collapse into 1
Source Link
rene
  • 91.1k
  • 17
  • 241
  • 511

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

The list of supported language codes (after the lang-) can be found at code-prettify:

"bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml", "xsl".

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

The list of supported language codes (after the lang-) can be found at code-prettify:

"bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml", "xsl".

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.

See more:
Changes to syntax highlighting

This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.

The spec is:

<!-- language: lang-or-tag-here -->

    code goes here

<!-- language: lang-or-tag-here -->

    code goes here

You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.

Use <!-- language-all: lang-or-tag --> to use the given highlighting for all the following code blocks.

practical examples

For those with little time...

<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->

Suppress any syntax highlighting (prevents poor, misleading guesses)

<!-- language: lang-none -->

Use language-all and your syntax highlighting choice shall be used for all code blocks that follow:

<!-- language-all: lang-html -->

Available Language Hints Moved

Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:

What is syntax highlighting and how does it work?

adding SPECIFIC examples (because I came here dozens of times, and being pointed elsewhere and to entire specs, if all I want is a quick snippet...) "Uncommented" »Available...«, otherweise the 2 quote boxes collapse into 1
Source Link
Loading
replaced http://meta.stackexchange.com/ with https://meta.stackexchange.com/
Source Link
Loading
Fixup of bad MSO links to MSE links migration
Source Link
Loading
Migration of MSO links to MSE links
Source Link
Loading
deleted 907 characters in body
Source Link
animuson StaffMod
  • 189.3k
  • 38
  • 578
  • 849
Loading
Rollback to Revision 10 - Please stop approving edits to this list without doing research first. See http://meta.stackoverflow.com/q/172966 if you want to support Dart highlighting.
Source Link
animuson StaffMod
  • 189.3k
  • 38
  • 578
  • 849
Loading
added 5 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
added 1014 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
added 11 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
added 109 characters in body
Source Link
balpha StaffMod
  • 155.5k
  • 44
  • 495
  • 665
Loading
added 415 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
deleted 8 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
deleted 114 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
added 617 characters in body
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading
Source Link
Jeff Atwood
  • 310.6k
  • 107
  • 888
  • 1.2k
Loading