Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add code tags to Pygments output #91
At present, when using Pygments to highlight code, your code is only wrapped in pre tags.
Semantically, however, best practice is to first wrap code in <code> tags, with an optional class which contains the specific language used in the given code block. In fact, the HTML5 spec has adopted this practice and it will be part of the final specification.
Interestingly, when Pygments is not enabled, Jekyll will render code blocks using codehighlighter-style markup, which does include <code> tags correctly.
Here's a fork which updates Pygments output to include <code> tags and thus be more semantic and improve HTML5 compliance:
(Ideally, this change should be pushed back to albino.rb, but since that's a core part of GitHub, mojombo and friends may be understandably slow to accept a patch on that.)