Skip to content

Commit

Permalink
fix calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Jul 2, 2019
1 parent 2b63f3b commit 59ec6fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ InlineLexer.prototype.output = function(src) {
if (cap = this.rules.link.exec(src)) {
var lastParenIndex = findClosingBracket(cap[2], '()');
if (lastParenIndex > -1) {
var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length;
var linkLen = 4 + cap[1].length + lastParenIndex;
cap[2] = cap[2].substring(0, lastParenIndex);
cap[0] = cap[0].substring(0, linkLen).trim();
cap[3] = '';
Expand Down

0 comments on commit 59ec6fb

Please sign in to comment.