Added test case for github codeblock at start of string

This commit is contained in:
Titus 2012-06-14 00:08:49 -06:00
parent 6515742ea9
commit fa38885994
3 changed files with 16 additions and 1 deletions

View File

@ -910,12 +910,13 @@ var _DoGithubCodeBlocks = function(text) {
var language = m1;
var codeblock = m2;
console.log('codeblock', '|' + codeblock + '|');
codeblock = _EncodeCode(codeblock);
codeblock = _Detab(codeblock);
codeblock = codeblock.replace(/^\n+/g,""); // trim leading newlines
codeblock = codeblock.replace(/\n+$/g,""); // trim trailing whitespace
codeblock = "<pre><code" + (language ? " class=\"" + language : "\"") + ">" + codeblock + "\n</code></pre>";
codeblock = "<pre><code" + (language ? " class=\"" + language + '"' : "") + ">" + codeblock + "\n</code></pre>";
return hashBlock(codeblock);
}

View File

@ -0,0 +1,7 @@
<pre><code>function MyFunc(a) {
// ...
}
</code></pre>
<p>That is some code!</p>

View File

@ -0,0 +1,7 @@
```
function MyFunc(a) {
// ...
}
```
That is some code!