Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I created an answer here:

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

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

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

You must log in to answer this question.

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