Skip to content

Commit

Permalink
fix(blockQuote): fix 'github style codeblocks' not being parsed insid…
Browse files Browse the repository at this point in the history
…e 'blockquote'

Closes #192
  • Loading branch information
tivie committed Aug 25, 2015
1 parent e754668 commit ed2cf59
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/subParsers/blockQuotes.js
Expand Up @@ -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 ');
Expand Down
15 changes: 15 additions & 0 deletions 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 changes: 13 additions & 0 deletions 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>
>> ```

0 comments on commit ed2cf59

Please sign in to comment.