diff --git a/TwittiaCore.js b/TwittiaCore.js index 7ffb652..4f2380e 100644 --- a/TwittiaCore.js +++ b/TwittiaCore.js @@ -307,13 +307,13 @@ Twittia.prototype.authorizationHeader = function(method, url, params) { } function replaceURLWithHTMLLinks(text) { - var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_()|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; + var exp = /(\b(https?|ftp|file):\/\/\S+)/ig; return text.replace(exp,"$1"); } function replaceTwitterLinks(text) { - var username = /(^|[^\/\w])(@)([-A-Z0-9+_\.ÅÖÄÜ]+[^\.,;\W])/ig; - var hash = /(^|[^\/\w])(#)([-A-Z0-9+_\.ÅÖÄÜß]+[^\.,;\W])/ig; + var username = /(^|\s)(@)(\S*)/ig; + var hash = /(^|\s)(#)(\S*)/ig; text = text.replace(username, "$1$2$3"); return text.replace(hash, "$1$2$3"); }