fix @user and #hash again

This commit is contained in:
Samuel Reis 2010-09-21 20:28:33 +02:00
parent 8dc84b2f5d
commit 7182a25c28

View file

@ -312,8 +312,8 @@ function replaceURLWithHTMLLinks(text) {
}
function replaceTwitterLinks(text) {
var username = /(^|\s)(@)(\w*)/ig;
var hash = /(^|\s)(#)(\w*)/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>");
}