diff --git a/dist/showdown.js b/dist/showdown.js index 2e0f6bf..5f9334c 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 ec138f8..945e95a 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 f247d69..834b07b 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 d2d2444..3ca44a7 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 75617ba..f197979 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