Fixed #18 -- class= isn't added if the language is not specified

This commit is contained in:
Titus 2012-06-13 23:43:13 -06:00
parent ecdd68a4a3
commit 29e2f1a039

View File

@ -915,7 +915,7 @@ var _DoGithubCodeBlocks = function(text) {
codeblock = codeblock.replace(/^\n+/g,""); // trim leading newlines
codeblock = codeblock.replace(/\n+$/g,""); // trim trailing whitespace
codeblock = "<pre><code class=" + language + ">" + codeblock + "\n</code></pre>";
codeblock = "<pre><code" + (language ? " class=" + language : "") + ">" + codeblock + "\n</code></pre>";
return hashBlock(codeblock);
}