This question already has an answer here:
According to the editing help:
You can use either one of the supported prettify language codes, like lang-cpp or lang-sql, or you can specify a tag, and the syntax highlighting language associated with this tag will be used:
<!-- language: c# --> public static bool IsAwesome { get { return true; } }
However, in this revision history, <!-- language: python -->
fails, yet <!-- language: lang-py -->
works. python is clearly a valid tag, so I'd expect both to work
This also would explain why questions tagged python do not automatically use python syntax highlighting
lang-py
, so this behaviour is expected. Now, I don't know why python isn't associated with thelang-py
highlighter, so that might be unintentional. – Tim Stone 2 days ago