Skip to content

Commit cf2a70c

Browse files
committed
Merge branch 'develop'
2 parents b81c416 + 5025623 commit cf2a70c

18 files changed

+105
-23
lines changed

dist/showdown.js

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/converter.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
* Showdown Converter class
77
* @class
88
* @param {object} [converterOptions]
9-
* @returns {
10-
* {makeHtml: Function},
11-
* {setOption: Function},
12-
* {getOption: Function},
13-
* {getOptions: Function}
14-
* }
9+
* @returns {Converter}
1510
*/
1611
showdown.Converter = function (converterOptions) {
1712
'use strict';

src/subParsers/blockGamut.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
showdown.subParser('blockGamut', function (text, options, globals) {
66
'use strict';
77

8+
// we parse blockquotes first so that we can have headings and hrs
9+
// inside blockquotes
10+
text = showdown.subParser('blockQuotes')(text, options, globals);
811
text = showdown.subParser('headers')(text, options, globals);
912

1013
// Do Horizontal Rules:
@@ -13,10 +16,9 @@ showdown.subParser('blockGamut', function (text, options, globals) {
1316
text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, key);
1417
text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, key);
1518

16-
text = showdown.subParser('tables')(text, options, globals);
1719
text = showdown.subParser('lists')(text, options, globals);
1820
text = showdown.subParser('codeBlocks')(text, options, globals);
19-
text = showdown.subParser('blockQuotes')(text, options, globals);
21+
text = showdown.subParser('tables')(text, options, globals);
2022

2123
// We already ran _HashHTMLBlocks() before, in Markdown(), but that
2224
// was to escape raw HTML in the original Markdown source. This time,

src/subParsers/blockQuotes.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ showdown.subParser('blockQuotes', function (text, options, globals) {
1414
/gm, function(){...});
1515
*/
1616

17-
text = text.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm, function (wholeMatch, m1) {
17+
text = text.replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function (wholeMatch, m1) {
1818
var bq = m1;
1919

2020
// attacklab: hack around Konqueror 3.5.4 bug:
@@ -25,6 +25,7 @@ showdown.subParser('blockQuotes', function (text, options, globals) {
2525
bq = bq.replace(/~0/g, '');
2626

2727
bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
28+
bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
2829
bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
2930

3031
bq = bq.replace(/(^|\n)/g, '$1 ');

src/subParsers/lists.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ showdown.subParser('lists', function (text, options, globals) {
88
* Process the contents of a single ordered or unordered list, splitting it
99
* into individual list items.
1010
* @param {string} listStr
11+
* @param {boolean} trimTrailing
1112
* @returns {string}
1213
*/
1314
function processListItems (listStr, trimTrailing) {
@@ -95,6 +96,7 @@ showdown.subParser('lists', function (text, options, globals) {
9596
* Check and parse consecutive lists (better fix for issue #142)
9697
* @param {string} list
9798
* @param {string} listType
99+
* @param {boolean} trimTrailing
98100
* @returns {string}
99101
*/
100102
function parseConsecutiveLists(list, listType, trimTrailing) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<blockquote>
2+
<p>a blockquote with a 4 space indented line (not code)</p>
3+
</blockquote>
4+
<p>sep</p>
5+
<blockquote>
6+
<p>a blockquote</p>
7+
</blockquote>
8+
<pre><code>with some code after
9+
</code></pre>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
> a blockquote
2+
with a 4 space indented line (not code)
3+
4+
sep
5+
6+
> a blockquote
7+
8+
with some code after
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<pre><code>&gt; this is a pseudo blockquote
2+
&gt; inside a code block
3+
</code></pre>
4+
5+
<p>foo</p>
6+
<pre><code>&gt; this is another bq
7+
inside code
8+
</code></pre>

test/cases/blockquote-inside-code.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
> this is a pseudo blockquote
2+
> inside a code block
3+
4+
foo
5+
6+
> this is another bq
7+
inside code
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<blockquote>
2+
<p>Define a function in javascript:</p>
3+
4+
<pre><code>function MyFunc(a) {
5+
var s = '`';
6+
}
7+
</code></pre>
8+
9+
<blockquote>
10+
<p>And some nested quote</p>
11+
12+
<pre><code class="html language-html">&lt;div&gt;HTML!&lt;/div&gt;
13+
</code></pre>
14+
</blockquote>
15+
</blockquote>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
> Define a function in javascript:
2+
>
3+
> ```
4+
> function MyFunc(a) {
5+
> var s = '`';
6+
> }
7+
> ```
8+
>
9+
>> And some nested quote
10+
>>
11+
>> ```html
12+
>> <div>HTML!</div>
13+
>> ```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p>some text</p>
2+
3+
<pre><code>| Tables | Are | Cool |
4+
| ------------- |:-------------:| -----:|
5+
| **col 3 is** | right-aligned | $1600 |
6+
| col 2 is | *centered* | $12 |
7+
| zebra stripes | ~~are neat~~ | $1 |
8+
</code></pre>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
some text
2+
3+
4+
| Tables | Are | Cool |
5+
| ------------- |:-------------:| -----:|
6+
| **col 3 is** | right-aligned | $1600 |
7+
| col 2 is | *centered* | $12 |
8+
| zebra stripes | ~~are neat~~ | $1 |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<blockquote>
2+
<p>a blockquote</p>
3+
<h1 id="followedbyanheading">followed by an heading</h1>
4+
</blockquote>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> a blockquote
2+
# followed by an heading

0 commit comments

Comments
 (0)