diff --git a/src/showdown.js b/src/showdown.js index 356c16c..6c51a3a 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -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 = "
" + codeblock + "\n
"; + codeblock = "
" + codeblock + "\n
"; return hashBlock(codeblock); } diff --git a/test/cases/github-style-at-start.html b/test/cases/github-style-at-start.html new file mode 100644 index 0000000..8f5dd94 --- /dev/null +++ b/test/cases/github-style-at-start.html @@ -0,0 +1,7 @@ + +
function MyFunc(a) {
+    // ...
+}
+
+ +

That is some code!

\ No newline at end of file diff --git a/test/cases/github-style-at-start.md b/test/cases/github-style-at-start.md new file mode 100644 index 0000000..c7247fe --- /dev/null +++ b/test/cases/github-style-at-start.md @@ -0,0 +1,7 @@ +``` +function MyFunc(a) { + // ... +} +``` + +That is some code! \ No newline at end of file