hoedown/hoedown — pull request #38 by jmendeth (2014-01-06 00:14:34+00:00)
Title: Simplify and harden fenced code blocks

Sundown has unintuitive behaviour for fenced code, especially the `language` that gets passed to the callbacks.

For example, this will pass (language `mylang`):

``` mylang

This will not:

``` mylang secondlang third

But this will (language `mylang secondlang third`):

``` { mylang secondlang .third }

What's more, the HTML renderer actually treats the `language` attribute as a list of classes. The above renders as:

```html

```

This isn't healthy to have in a renderer-independent library like Hoedown. Therefore, I've simplified the ---rather quirky--- code in `markdown.c` to just *parse the first token and ignore the rest of the line* (7a18f64bba803be80963d9c02d98d774f9156d39). All renderers should now expect one word as the language.

While doing that, I found that code used that function incorrectly, passing more than two lines and using it to check end of block, etc. I have refactored and simplified that as well (25d2cfc75152a5ce4fc88bf1a271f0711c1f23e8).

Finally, I have removed the `HOEDOWN_HTML_PRETTYPRINT` feature. When present, Hoedown would add the class `prettyprint` to codeblocks and codespans. This complicates the code and supports one specific highlighting library, therefore it's not fair to have it here IMHO.

Instead, it now outputs **language classes**. According to the [HTML5 spec](http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element), classes like `language-java` are the correct way to mark languages in HTML. Highlighters like [Prism](http://prismjs.com) already support them.

*Implementation detail: In fenced code blocks, lines consisting only of spaces will now be copied verbatim.*

----

To summarize, this breaks compatibility, simplifies the code regarding fenced code blocks dramatically, improves performance, treats languages like they deserve, and replaces a library-specific feature with a standard one.