Skip to content

Commit

Permalink
Merge pull request #1497 from UziTech/revert-1464
Browse files Browse the repository at this point in the history
revert #1464
  • Loading branch information
joshbruce authored Jun 12, 2019
2 parents 396591a + 9c91e40 commit 5ba9ba5
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
Original file line number Diff line number Diff line change
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 5ba9ba5

Please sign in to comment.