Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

17
  • I think the current solution with the tag intelligence is a big improvement to what it was before. Especially VB code will look much better now. The only downside is non-language specific questions, that might get answers in VB.NET. Commented Jan 26, 2011 at 12:03
  • @awe indeed it will be formatted as a comment, unless you mix language tags and force default inference again.. looks fine to me, see stackoverflow.com/questions/4801650/… Commented Jan 26, 2011 at 12:19
  • Can we get this documented in the help pages? I've been looking around for this for a while and this is the first place I've found it, so if it is in help pages somewhere it's not visible enough. Commented May 31, 2012 at 2:10
  • @old you somehow missed it, see meta.stackoverflow.com/editing-help#syntax-highlighting -- same on all Stack Exchange sites Commented May 31, 2012 at 5:17
  • @Jeff, my bad. I was looking for something related to "language" and I was looking on Ask Different where it's near the bottom. Commented May 31, 2012 at 6:53
  • 4
    Great, thanks. But why do all the magic strings start lang-? Commented Apr 12, 2013 at 21:07
  • 1
    Thank you. FYI of all the solutions described here, only the <!-- language-all: lang-tag --> option worked for me. :/ Commented May 25, 2013 at 20:39
  • Is there any highlighter for DOS/Win shell scripts? Commented Jul 30, 2013 at 6:57
  • 6
    I wish we had this functionality built-in into post editor on SO. I always end up googling this and copy/pasting from this answer, which is counter-productive. Commented Sep 12, 2013 at 18:35
  • 6
    It's also far too sensitive - <!--language-all: ... --> doesn't work - no space before language. I end up at this post every single time I need this. Very frustrating that it's not in the editor and/or more forgiving Commented Nov 4, 2013 at 9:47
  • 9
    OMG I forget this thing every time... I've been back on this page for 145th time. They should bring some UI for language selection. Commented May 19, 2014 at 19:16
  • 1
    I suggest using simpler markup like GitHub's triple backtick - language or similar. I also have to google this every time. Commented Oct 28, 2014 at 15:41
  • 4
    I've googled this question over 10 times now. This syntax is impossible to remember for some reason. Can't remember if its lang or language, can't remember if it's lang-python language-python lang-py python-lang or just python or some other thing. At least I can remember that its <!-- --> and not <-- --!> Commented Jan 29, 2020 at 9:27
  • 2
    Where is a list of all the available language tags? Commented Feb 26, 2020 at 22:00
  • 1
    Google Code Pretty is no longer maintained: github.com/googlearchive/code-prettify/commit/…. Since there are still bugs which won't be fixed anymore, any plans to migrate to a different highlighter? Commented Jun 5, 2020 at 15:16