Skip to content

Commit 9c91e40

Browse files
committed
revert #1464
1 parent 396591a commit 9c91e40

File tree

2 files changed

+7
-37
lines changed

2 files changed

+7
-37
lines changed

lib/marked.js

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,7 @@ Lexer.prototype.token = function(src, top) {
200200
l,
201201
isordered,
202202
istask,
203-
ischecked,
204-
blockquote,
205-
count;
203+
ischecked;
206204

207205
while (src) {
208206
// newline
@@ -308,26 +306,16 @@ Lexer.prototype.token = function(src, top) {
308306
type: 'blockquote_start'
309307
});
310308

311-
blockquote = cap[0].replace(/^ *> ?/gm, '');
312-
count = 1;
313-
while (blockquote.match(/^ {0,3}>/)) {
314-
count++;
315-
this.tokens.push({
316-
type: 'blockquote_start'
317-
});
318-
blockquote = blockquote.replace(/^ *> ?/gm, '');
319-
}
309+
cap = cap[0].replace(/^ *> ?/gm, '');
320310

321311
// Pass `top` to keep the current
322312
// "toplevel" state. This is exactly
323313
// how markdown.pl works.
324-
this.token(blockquote, top);
314+
this.token(cap, top);
325315

326-
for (i = 0; i < count; i++) {
327-
this.tokens.push({
328-
type: 'blockquote_end'
329-
});
330-
}
316+
this.tokens.push({
317+
type: 'blockquote_end'
318+
});
331319

332320
continue;
333321
}
@@ -1253,27 +1241,13 @@ Parser.prototype.tok = function() {
12531241
return this.renderer.table(header, body);
12541242
}
12551243
case 'blockquote_start': {
1256-
var count = 1;
1257-
while (this.peek() && this.peek().type === 'blockquote_start') {
1258-
this.next();
1259-
count++;
1260-
}
1261-
12621244
body = '';
12631245

12641246
while (this.next().type !== 'blockquote_end') {
12651247
body += this.tok();
12661248
}
12671249

1268-
while (this.peek() && this.peek().type === 'blockquote_end') {
1269-
this.next();
1270-
}
1271-
1272-
for (i = 0; i < count; i++) {
1273-
body = this.renderer.blockquote(body);
1274-
}
1275-
1276-
return body;
1250+
return this.renderer.blockquote(body);
12771251
}
12781252
case 'list_start': {
12791253
body = '';

test/specs/redos/nested_blockquote.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)