fix @user and #hash

This commit is contained in:
Samuel Reis 2010-09-21 20:25:21 +02:00
parent 25ab48951f
commit 8dc84b2f5d

View file

@ -312,8 +312,8 @@ function replaceURLWithHTMLLinks(text) {
}
function replaceTwitterLinks(text) {
var username = /(^|\s)(@)(\S*)/ig;
var hash = /(^|\s)(#)(\S*)/ig;
var username = /(^|\s)(@)(\w*)/ig;
var hash = /(^|\s)(#)(\w*)/ig;
text = text.replace(username, "$1$2<a href='http://twitter.com/$3'>$3</a>");
return text.replace(hash, "$1$2<a href='http://search.twitter.com/search?q=%23$3'>$3</a>");
}