diff --git a/dist/showdown.js b/dist/showdown.js index 675c45f..5cacdeb 100644 Binary files a/dist/showdown.js and b/dist/showdown.js differ diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 4cd9ef3..2fb964f 100644 Binary files a/dist/showdown.js.map and b/dist/showdown.js.map differ diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 16c3cb5..e30d275 100644 Binary files a/dist/showdown.min.js and b/dist/showdown.min.js differ diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index 5806330..a394f17 100644 Binary files a/dist/showdown.min.js.map and b/dist/showdown.min.js.map differ diff --git a/src/subParsers/makehtml/githubCodeBlocks.js b/src/subParsers/makehtml/githubCodeBlocks.js index 660ba75..2976b49 100644 --- a/src/subParsers/makehtml/githubCodeBlocks.js +++ b/src/subParsers/makehtml/githubCodeBlocks.js @@ -20,7 +20,7 @@ showdown.subParser('makehtml.githubCodeBlocks', function (text, options, globals text += 'ยจ0'; - text = text.replace(/(?:^|\n)(```+|~~~+)([^\s`~]*)\n([\s\S]*?)\n\1/g, function (wholeMatch, delim, language, codeblock) { + text = text.replace(/(?:^|\n)(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n\1/g, function (wholeMatch, delim, language, codeblock) { var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n'; // First parse the github code block diff --git a/test/functional/makehtml/cases/standard/github-style-codeblock.html b/test/functional/makehtml/cases/standard/github-style-codeblock.html index 57fdf4e..f1f5856 100644 --- a/test/functional/makehtml/cases/standard/github-style-codeblock.html +++ b/test/functional/makehtml/cases/standard/github-style-codeblock.html @@ -6,6 +6,11 @@

And some HTML

<div>HTML!</div>
 
+

And some CSS with spaces before the language declaration

+
body {
+font-size: 1.5em;
+}
+

Use more than 3 backticks

some code
 
diff --git a/test/functional/makehtml/cases/standard/github-style-codeblock.md b/test/functional/makehtml/cases/standard/github-style-codeblock.md index bae8447..d84cf6d 100644 --- a/test/functional/makehtml/cases/standard/github-style-codeblock.md +++ b/test/functional/makehtml/cases/standard/github-style-codeblock.md @@ -13,6 +13,14 @@ And some HTML
HTML!
``` +And some CSS with spaces before the language declaration + +``` css +body { + font-size: 1.5em; +} +``` + Use more than 3 backticks `````