What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I created an answer here: http://stackoverflow.com/a/11934671/1442342

But the Python syntax is not highlighting.

Does the tag not give a highlighting hint or have I done something wrong?

share|improve this question
add comment

3 Answers

up vote 11 down vote accepted

Apparently not; I've added the tag to the question and the code highlighting is now working.

I've also removed the tag from that question though, it is not the right tag for the question.

For future reference, you can also mark your code blocks with an explicit code hint:

<!-- language: lang-py -->

See How do I format my code blocks? for details.

share|improve this answer
add comment

I set lang-py as the code language used for syntax highlighting for the tag. It was previously set to none (the default). This should fix the problem for any other questions tagged but not .

share|improve this answer
add comment

The reason is that the version-specific tags need to be explicitly added by the admins/mods in order to pick up syntax highlighting for the base language, in cases where the base tag (or any other tag that defaults to the same language) is not included. I complained about this for SQL Server 2008 R2 and SQL Server 2012:

"sql-server" type tags not defaulting to SQL-lang for the code editor (prettify)

The general solution going forward seems to be to add explicit version tags to the syntax highlighter as they come out, rather than solve for all potential versions using regex or wildcards. Which I think is more scalable but seems to be opposed.

share|improve this answer
add comment

You must log in to answer this question.

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