One more change to the regex for hashtags, to account for typical usage seen on twitter

This commit is contained in:
Anna 2010-06-02 12:55:31 -04:00
parent 46dcec4ce8
commit c775f7f74a

View File

@ -475,7 +475,7 @@ class TweetBox(gtk.HBox):
new_text = re.sub(r"(http://.*?)([^0-9a-zA-Z.~/_?=&-]|$)", r'<a href="\1">\1</a>\2', new_text) new_text = re.sub(r"(http://.*?)([^0-9a-zA-Z.~/_?=&-]|$)", r'<a href="\1">\1</a>\2', new_text)
# Make @ or # refs into links, to be used internally # Make @ or # refs into links, to be used internally
new_text = re.sub(r'@(.*?)([^0-9a-zA-Z_]|$)', self._make_user_link, new_text) new_text = re.sub(r'@(.*?)([^0-9a-zA-Z_]|$)', self._make_user_link, new_text)
new_text = re.sub(r'#(.*?)([ ;,.:]|$)', self._make_hashtag_link, new_text) new_text = re.sub(r'#(.*?)([ ;,.:*v]|$)', self._make_hashtag_link, new_text)
self.text.set_markup(new_text) self.text.set_markup(new_text)
# If this is in reply to something, set appropriate label # If this is in reply to something, set appropriate label