54

Possible Duplicate:
Interface options for specifying language prettify

I don't know how Markdown recognizes which language to use in code blocks. Sometimes it doesn't guess right. Can I specify a code block's language myself? If so, how?

6
  • 1
    It used Google Prettify meta.stackexchange.com/questions/14664/…. Your question pretty much dups this meta.stackexchange.com/questions/981/…, and lots of others.
    – Zoredache
    Commented Jan 7, 2011 at 8:56
  • 2
    Is this really a feature request? It doesn't sound like one. If you want a possibility to choose the language yourself, then this is a dupe. Right now, only the algorithm determines the "correct" language. Commented Jan 7, 2011 at 8:57
  • @Shog9 it seems wrong to close a specific question by calling it a duplicate of a generic question, even if the answer is somewhere in there.
    – Bob Stein
    Commented Nov 6, 2017 at 20:09
  • The answer has changed over time, @BobStein-VisiBone - the linked question is kept up to date, this answer probably won't be.
    – Shog9
    Commented Nov 6, 2017 at 23:56
  • 8
    <!-- language: «lang-or-tag-here» --> in stackoverflow, ` ```«lang-or-tag-here» ` elsewhere...
    – masterxilo
    Commented Sep 24, 2018 at 12:53
  • BTW, should add <!-- language: xxx --> before code block ```, not inside.
    – Eric
    Commented Apr 19, 2023 at 8:41

1 Answer 1

21

(Note, I'm answering the body of your question, not the title)

The tags on your question are used to determine the language for the code blocks.

I'm not sure how that works if you have multiple languages in your tags, or for code golf questions.

4

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