Skip to content

Commit

Permalink
Merge pull request markedjs#1497 from UziTech/revert-1464
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbruce committed Jun 12, 2019
2 parents 0f3669e + 0b3be63 commit 0cc0688
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 37 deletions.
40 changes: 7 additions & 33 deletions lib/marked.js
Expand Up @@ -200,9 +200,7 @@ Lexer.prototype.token = function(src, top) {
l,
isordered,
istask,
ischecked,
blockquote,
count;
ischecked;

while (src) {
// newline
Expand Down Expand Up @@ -308,26 +306,16 @@ Lexer.prototype.token = function(src, top) {
type: 'blockquote_start'
});

blockquote = cap[0].replace(/^ *> ?/gm, '');
count = 1;
while (blockquote.match(/^ {0,3}>/)) {
count++;
this.tokens.push({
type: 'blockquote_start'
});
blockquote = blockquote.replace(/^ *> ?/gm, '');
}
cap = cap[0].replace(/^ *> ?/gm, '');

// Pass `top` to keep the current
// "toplevel" state. This is exactly
// how markdown.pl works.
this.token(blockquote, top);
this.token(cap, top);

for (i = 0; i < count; i++) {
this.tokens.push({
type: 'blockquote_end'
});
}
this.tokens.push({
type: 'blockquote_end'
});

continue;
}
Expand Down Expand Up @@ -1253,27 +1241,13 @@ Parser.prototype.tok = function() {
return this.renderer.table(header, body);
}
case 'blockquote_start': {
var count = 1;
while (this.peek() && this.peek().type === 'blockquote_start') {
this.next();
count++;
}

body = '';

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

while (this.peek() && this.peek().type === 'blockquote_end') {
this.next();
}

for (i = 0; i < count; i++) {
body = this.renderer.blockquote(body);
}

return body;
return this.renderer.blockquote(body);
}
case 'list_start': {
body = '';
Expand Down
4 changes: 0 additions & 4 deletions test/specs/redos/nested_blockquote.js

This file was deleted.

0 comments on commit 0cc0688

Please sign in to comment.