2
$\begingroup$

In this meta question markdown is displayed along with the resulting rendered output for comparison. The markdown is displayed by putting it in a code block (adding four spaces in front by pressing ctrl-K), to prevent it from being converted.

This works as intended, but the syntax highlighting adds colour to some of the words in the code block. This does not prevent understanding, but does break the flow of reading while the reader wonders whether the colour is relevant.

Is there a way of displaying code blocks without colour? Unless there's a completely unrelated approach that I'm missing, I'm imagining either some way of switching off syntax highlighting for a specific post/code block, or a language setting that will leave most text uncoloured.

Examples

Default (no language specified):

# Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.

Python specified:

# Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.

Java specified:

# Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.

Different languages have subtly different colourings but I don't know of one which will leave the text uncoloured.

$\endgroup$

1 Answer 1

4
$\begingroup$

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

# Lorem Ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.

see this meta question for which ones are available

$\endgroup$
1
  • $\begingroup$ Wow. I tried various combinations of "none" but didn't stumble upon this one. That's great, thank you :) $\endgroup$ Commented Sep 18, 2015 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .