Skip to content

Commit

Permalink
support older regex engines
Browse files Browse the repository at this point in the history
  • Loading branch information
smhg committed Jan 1, 2018
1 parent 18deb8b commit d978de4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,9 @@ function resolveUrl(base, href) {
base = baseUrls[' ' + base];

if (href.slice(0, 2) === '//') {
return base.replace(/:[^]*/, ':') + href;
return base.replace(/:[\s\S]*/, ':') + href;
} else if (href.charAt(0) === '/') {
return base.replace(/(:\/*[^/]*)[^]*/, '$1') + href;
return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
} else {
return base + href;
}
Expand Down

0 comments on commit d978de4

Please sign in to comment.