From ed2cf595b0bf920c3ca08fd0361387badc91ebd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Tue, 25 Aug 2015 21:10:49 +0100 Subject: [PATCH] fix(blockQuote): fix 'github style codeblocks' not being parsed inside 'blockquote' Closes #192 --- dist/showdown.js | Bin 64037 -> 64108 bytes dist/showdown.js.map | Bin 206895 -> 207077 bytes dist/showdown.min.js | Bin 23041 -> 23082 bytes dist/showdown.min.js.map | Bin 25354 -> 25403 bytes src/subParsers/blockQuotes.js | 1 + .../github-style-codeblock-inside-quote.html | 15 +++++++++++++++ .../github-style-codeblock-inside-quote.md | 13 +++++++++++++ 7 files changed, 29 insertions(+) create mode 100644 test/cases/github-style-codeblock-inside-quote.html create mode 100644 test/cases/github-style-codeblock-inside-quote.md diff --git a/dist/showdown.js b/dist/showdown.js index 89a537bb766f7b3f6926d39519d9dcd22a8aa9ef..c49a8a6f6cf13fb1aac5c21168d80faa3b39cca8 100644 GIT binary patch delta 51 zcmZ4bh55}FW&vw`Ek%XmjQsMH{PH{nBh!rnqUn=)y96g2q)SYm@5IWKR5N delta 31 ncmaF!g?Z^0W&vw`Ek%XmjQsMH{PH{nBjb$%qUnos(kBA|!fXqv diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 4d56677b2306414962e6c4ce6cee865e7e6323dd..776b97463e9ac9aae67f67d11e67b8145688d61e 100644 GIT binary patch delta 93 zcmZ2~f#>N(o(->WP4Ae)$TPh?nbBbSj0ucFlQ+y|oiveka={llkf6@w?h7K5D{m@* w#3w(vDY7~5wh#-WadYGS?Tz;t1D8%ex|&IlMN=cGaC#yev()zOEld@Q0pY4B&Hw-a delta 66 zcmV-I0KNa^(G0K946y6klkoHkllR&zvyIzd1OqWcN|VtWACtf`3X^T<36r3h29v4j Y8G}IJw?N{>;et9m4yOOqmSnyAOHXW diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 5e40d7ca57489657679640d31856310ba683a1af..8057c7527a779ab0a80c32af023129f30c7bc881 100644 GIT binary patch delta 48 zcmZqN!nkS+Bfq|uqC#;-etAlMd7gri=|+BO^~uRD!W?NjNjk}zI%$*ZT%dI_5hWx$3w& ZI(nKqgQ(zO9d}3PDwka6&HMCxOaNnc7T5p) delta 43 ycmdmejIrw&;|5+mj&f&59e>9vr^z4v#U^X(X|fkPg#ZO|CP(X)Z)VoFFaZEirw&vA diff --git a/src/subParsers/blockQuotes.js b/src/subParsers/blockQuotes.js index 909aaee..257e068 100644 --- a/src/subParsers/blockQuotes.js +++ b/src/subParsers/blockQuotes.js @@ -25,6 +25,7 @@ showdown.subParser('blockQuotes', function (text, options, globals) { bq = bq.replace(/~0/g, ''); bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines + bq = showdown.subParser('githubCodeBlocks')(bq, options, globals); bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse bq = bq.replace(/(^|\n)/g, '$1 '); diff --git a/test/cases/github-style-codeblock-inside-quote.html b/test/cases/github-style-codeblock-inside-quote.html new file mode 100644 index 0000000..85fa51c --- /dev/null +++ b/test/cases/github-style-codeblock-inside-quote.html @@ -0,0 +1,15 @@ +
+

Define a function in javascript:

+ +
function MyFunc(a) {
+  var s = '`';
+  }
+
+ +
+

And some nested quote

+ +
<div>HTML!</div>
+
+
+
diff --git a/test/cases/github-style-codeblock-inside-quote.md b/test/cases/github-style-codeblock-inside-quote.md new file mode 100644 index 0000000..23c4714 --- /dev/null +++ b/test/cases/github-style-codeblock-inside-quote.md @@ -0,0 +1,13 @@ +> Define a function in javascript: +> +> ``` +> function MyFunc(a) { +> var s = '`'; +> } +> ``` +> +>> And some nested quote +>> +>> ```html +>>
HTML!
+>> ```