This commit is contained in:
Tony Brix 2019-06-05 11:04:38 -05:00
parent 396591a2bc
commit 9c91e40e3b
2 changed files with 7 additions and 37 deletions

View File

@ -200,9 +200,7 @@ Lexer.prototype.token = function(src, top) {
l,
isordered,
istask,
ischecked,
blockquote,
count;
ischecked;
while (src) {
// newline
@ -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;
}
@ -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 = '';

View File

@ -1,4 +0,0 @@
module.exports = {
markdown: '>'.repeat(5000),
html: '<blockquote>'.repeat(5000) + '</blockquote>'.repeat(5000)
};