Skip to content

Commit 59ec6fb

Browse files
committed
fix calculation
1 parent 2b63f3b commit 59ec6fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/marked.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ InlineLexer.prototype.output = function(src) {
728728
if (cap = this.rules.link.exec(src)) {
729729
var lastParenIndex = findClosingBracket(cap[2], '()');
730730
if (lastParenIndex > -1) {
731-
var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length;
731+
var linkLen = 4 + cap[1].length + lastParenIndex;
732732
cap[2] = cap[2].substring(0, lastParenIndex);
733733
cap[0] = cap[0].substring(0, linkLen).trim();
734734
cap[3] = '';

0 commit comments

Comments
 (0)