fix @user and #hash
This commit is contained in:
parent
25ab48951f
commit
8dc84b2f5d
1 changed files with 2 additions and 2 deletions
|
@ -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>");
|
||||
}
|
||||
|
|
Reference in a new issue