Skip to content

Commit

Permalink
feat(subParsers/githubCodeBlock): add extra language class to conform…
Browse files Browse the repository at this point in the history
… to html5 spec
  • Loading branch information
tivie committed Jul 13, 2015
1 parent 6176977 commit b7f5e32
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/subParsers/githubCodeBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion test/cases/github-style-codeblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit b7f5e32

Please sign in to comment.