tanoku/redcarpet — Issue #93: Follow the the HTML5 standard for language hint classes on <code> elements
Author: ogier
Created: 2011-12-26 15:35:51+00:00
State: open

The HTML5 standard defines a way to hint that a code block contains syntax of a specific language [[link]](http://dev.w3.org/html5/spec/Overview.html#the-code-element). Redcarpet's code hints are almost identical, except that they don't include the `"language-"` prefix in the class attribute on the `` tag.

For example, the following markdown rendered with `:fenced_code_blocks` enabled

``` python
def foo(bar):
return bar
```

generates the following HTML:

``` html

def foo(bar):
return bar

```

Whereas the standard suggests that it generate:

``` html

def foo(bar):
return bar

```

Making this change would make Redcarpet's generated HTML more compatible with downstream syntax highlighting and processing, for example [nanoc's colorize_syntax filter](https://github.com/ddfreyne/nanoc/blob/master/lib/nanoc/filters/colorize_syntax.rb). There may be some current highlighters that depend on the current implementation of a plain language name, but in the long term it makes sense for everyone to follow the standard.