Skip to content

Commit 34b5947

Browse files
committed
history.js: adjust hyperlink regex to not break...
- For markdown links [sample](http://example.com) - And links at the end of a sentence, like http://example.com.
1 parent eff1058 commit 34b5947

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Resources/html/views/history/history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ var loadCommit = function(commitObject, currentRef) {
177177

178178
var textToHTML = function (txt) {
179179
return (" "+txt+" ")
180-
.replace(/\b(https?:\/\/[^\s<]*)/ig, "<a href=\"$1\">$1</a>")
180+
.replace(/(https?:\/\/([^\s\.\)\]\<]+|\.[^\s])+)/ig, "<a href=\"$1\">$1</a>")
181181
.replace(/\n/g,"<br>")
182182
.trim();
183183
}

0 commit comments

Comments
 (0)