2

How can we make a code sample without any color being applied to that code?

Example

A classic use case would be console output, which often looks clearer inside code sample formatting, but isn't itself code. Note: I realise that's subjective, so for precision, please assume this question only applies where the author intends to place something which isn't strictly code inside code sample formatting (i.e. that they haven't done so in error)

Random example here; it's arguably easier to read in code sample formatting (even though it's strictly not code, but console output), but would be ideal to limit the color to black only (i.e. no blue)

Enter image description here

I'm sure this would have been asked before, but I can't spot it via searches.

7
  • 4
    Add the none language tag May 24, 2020 at 19:58
  • @CertainPerformance brilliant! thanks. should I delete this question?
    – stevec
    May 24, 2020 at 19:59
  • @CertainPerformance sorry to have asked it, I knew it would be somewhere
    – stevec
    May 24, 2020 at 19:59
  • 1
    Hint for searching: Stack Exchange search isn’t very good, so use Google and search like this: site:meta.stackoverflow.com disable syntax-highlighting. May 24, 2020 at 20:01
  • @user4642212 thanks I will remember to search that way. Regarding the related question, I hadn't encountered this sort of structure before <!-- language: lang-<language> --> It looks like HTML commenting, with some key/value inside.
    – stevec
    May 24, 2020 at 20:03
  • 3
    @stevec I wouldn't delete this. Duplicate questions aren't inherently bad. They provide signposts, so other people have an easier time finding the answers.
    – Makyen Mod
    May 24, 2020 at 20:04
  • 2
    @stevec If you're using code fences there's an even easier shorthand - just add the language tag at the end of the opening fence, e.g. ```java or ```none May 27, 2020 at 0:13

0

Browse other questions tagged .