diff --git a/src/showdown.js b/src/showdown.js index 6c51a3a..2b9d632 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -905,7 +905,7 @@ var _DoGithubCodeBlocks = function(text) { // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug text += "~0"; - text = text.replace(/(?:^|\n)```(.*)\n([^`]+)\n```/g, + text = text.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(wholeMatch,m1,m2) { var language = m1; var codeblock = m2; diff --git a/test/cases/github-style-codeblock.html b/test/cases/github-style-codeblock.html index 39d1fa0..fc4187e 100644 --- a/test/cases/github-style-codeblock.html +++ b/test/cases/github-style-codeblock.html @@ -3,7 +3,7 @@
Define a function in javascript:
function MyFunc(a) {
- // ...
+ var s = '`';
}
diff --git a/test/cases/github-style-codeblock.md b/test/cases/github-style-codeblock.md
index 5c59c1d..ce4ecc5 100644
--- a/test/cases/github-style-codeblock.md
+++ b/test/cases/github-style-codeblock.md
@@ -3,7 +3,7 @@ Define a function in javascript:
```
function MyFunc(a) {
- // ...
+ var s = '`';
}
```