fix url replace to include brackets

This commit is contained in:
Samuel Reis 2010-09-18 12:29:13 +02:00
parent cf5b53586f
commit cc46e88522

View file

@ -306,7 +306,7 @@ Twittia.prototype.authorizationHeader = function(method, url, params) {
} }
function replaceURLWithHTMLLinks(text) { function replaceURLWithHTMLLinks(text) {
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_()|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1'>$1</a>"); return text.replace(exp,"<a href='$1'>$1</a>");
} }