From d7597f173265dc8bf2c3d0aa0f39b9f0fbf5103c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:47:34 +0100 Subject: [PATCH] allow link definitions in blockquotes too --- lib/marked.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index e83b2a29..7dfdd4ee 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -155,7 +155,7 @@ Lexer.prototype.lex = function(src) { * Lexing */ -Lexer.prototype.token = function(src, top, bq) { +Lexer.prototype.token = function(src, top) { var src = src.replace(/^ +$/gm, '') , next , loose @@ -278,7 +278,7 @@ Lexer.prototype.token = function(src, top, bq) { // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. - this.token(cap, top, true); + this.token(cap, top); this.tokens.push({ type: 'blockquote_end' @@ -347,7 +347,7 @@ Lexer.prototype.token = function(src, top, bq) { }); // Recurse. - this.token(item, false, bq); + this.token(item, false); this.tokens.push({ type: 'list_item_end' @@ -376,7 +376,7 @@ Lexer.prototype.token = function(src, top, bq) { } // def - if ((!bq && top) && (cap = this.rules.def.exec(src))) { + if (top && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1); this.tokens.links[cap[1].toLowerCase()] = {