소스 검색

fix(blockQuote): fix 'github style codeblocks' not being parsed inside 'blockquote'

Closes #192
Estevão Soares dos Santos 10 년 전
부모
커밋
ed2cf595b0

+ 2 - 1
dist/showdown.js

@@ -1,4 +1,4 @@
-;/*! showdown 23-08-2015 */
+;/*! showdown 25-08-2015 */
 (function(){
 /**
  * Created by Tivie on 13-07-2015.
@@ -1077,6 +1077,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  ');

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/showdown.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/showdown.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/showdown.min.js.map


+ 1 - 0
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  ');

+ 15 - 0
test/cases/github-style-codeblock-inside-quote.html

@@ -0,0 +1,15 @@
+<blockquote>
+<p>Define a function in javascript:</p>
+
+<pre><code>function MyFunc(a) {
+  var s = '`';
+  }
+</code></pre>
+
+<blockquote>
+<p>And some nested quote</p>
+
+<pre><code class="html language-html">&lt;div&gt;HTML!&lt;/div&gt;
+</code></pre>
+</blockquote>
+</blockquote>

+ 13 - 0
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
+>> <div>HTML!</div>
+>> ```

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.