feat(subParsers/githubCodeBlock): add extra language class to conform to html5 spec

This commit is contained in:
Estevão Soares dos Santos 2015-07-14 00:41:59 +01:00
parent 6176977558
commit b7f5e32e1a
6 changed files with 2 additions and 2 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -32,7 +32,7 @@ showdown.subParser('githubCodeBlocks', function (text, options, globals) {
codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
codeblock = '<pre><code' + (language ? ' class="' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
return showdown.subParser('hashBlock')(codeblock, options, globals);
});

View File

@ -7,5 +7,5 @@
<p>And some HTML</p>
<pre><code class="html">&lt;div&gt;HTML!&lt;/div&gt;
<pre><code class="html language-html">&lt;div&gt;HTML!&lt;/div&gt;
</code></pre>