mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Fixed #18 -- class= isn't added if the language is not specified
This commit is contained in:
parent
ecdd68a4a3
commit
29e2f1a039
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user