Skip to main content
thanks are not part of a proper answer :)
Source Link
dessert
  • 40.7k
  • 17
  • 36

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a post's tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

For more information see What is syntax highlighting and how does it work? | MSE.


Thanks to dessert for the links to the documentation!

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a post's tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

For more information see What is syntax highlighting and how does it work? | MSE.


Thanks to dessert for the links to the documentation!

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a post's tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

For more information see What is syntax highlighting and how does it work? | MSE.

added 472 characters in body
Source Link
Zanna Mod
  • 71.6k
  • 3
  • 67
  • 161

What you are seeing there is syntax highlightingsyntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a posts tagsapplied automatically according to a post's tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

For more information see What is syntax highlighting and how does it work? | MSE.


Thanks to dessert for the links to the documentation!

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a posts tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a post's tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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

For more information see What is syntax highlighting and how does it work? | MSE.


Thanks to dessert for the links to the documentation!

Source Link
Zanna Mod
  • 71.6k
  • 3
  • 67
  • 161

What you are seeing there is syntax highlighting. This can be formatted explicitly in a post, for example, you can turn on Bash syntax highlighting for a code snippet by adding a tag before it:

<!-- language: lang-bash -->

Syntax highlighting is also applied automatically according to a posts tags. In this case, the question has the tag , so all code in the question and all of its answers will be displayed with Python 3 syntax highlighting.

This is often not what you want... for example the question relates to Python but is mainly about package management and contains a code-formatted block of APT output. You can turn off syntax highlighting with a tag like this:

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

or to turn off all syntax highlighting in a post

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