From 9dc35bf65a9b38859181862f0f1270bb1d10d3f2 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 5 Mar 2019 20:51:46 -0600 Subject: [PATCH] remove title from link --- lib/marked.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index f34e2df0bc..ac39650c77 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -721,9 +721,10 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.link.exec(src)) { var lastParenIndex = findClosingBracket(cap[2], '()'); if (lastParenIndex > -1) { - var removeChars = cap[2].length - lastParenIndex; + var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length; cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, cap[0].length - removeChars); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ''; } src = src.substring(cap[0].length); this.inLink = true;