added test for urls2links function, fixing bug - asterisk is allowed in URLs query string

This commit is contained in:
El RIDO 2017-02-11 16:02:24 +01:00
parent b992bcc732
commit b00bcd1352
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 62 additions and 4 deletions

View file

@ -164,13 +164,13 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
var markup = '<a href="$1" rel="nofollow">$1</a>';
element.html(
element.html().replace(
/((http|https|ftp):\/\/[\w?=&.\/-;#@~%+-]+(?![\w\s?&.\/;#~%"=-]*>))/ig,
/((http|https|ftp):\/\/[\w?=&.\/-;#@~%+*-]+(?![\w\s?&.\/;#~%"=-]*>))/ig,
markup
)
);
element.html(
element.html().replace(
/((magnet):[\w?=&.\/-;#@~%+-]+)/ig,
/((magnet):[\w?=&.\/-;#@~%+*-]+)/ig,
markup
)
);