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?

  • 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
    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. 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
    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
    Nov 6, 2017 at 23:56
  • 8
    <!-- language: «lang-or-tag-here» --> in stackoverflow, ` ```«lang-or-tag-here» ` elsewhere...
    – masterxilo
    Sep 24, 2018 at 12:53
  • BTW, should add <!-- language: xxx --> before code block ```, not inside.
    – Eric
    Apr 19 at 8:41

1 Answer 1


(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.


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