Skip to content

Commit

Permalink
Merge branch 'master' into new-line-after-table
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Mar 8, 2019
2 parents 27fdafb + 5ed5271 commit 11d8f65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 11d8f65

Please sign in to comment.