Fixed parsing of double-quotes in tweet text

This commit is contained in:
Anna 2010-05-19 12:15:53 -04:00
parent 34b8bc6b58
commit 5c642bd479
2 changed files with 1 additions and 1 deletions

1
TODO
View File

@ -17,4 +17,3 @@ bugs:
considerable tweaks to python-twitter) considerable tweaks to python-twitter)
* "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround. * "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround.
* Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue * Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue
* Double-quotes are not parsed correctly in tweets

View File

@ -372,6 +372,7 @@ class TweetBox(gtk.HBox):
# and the text # and the text
new_text = status.text new_text = status.text
new_text = re.sub(r'&([^;]*?)( |$)', r'&\1\2', new_text) new_text = re.sub(r'&([^;]*?)( |$)', r'&\1\2', new_text)
new_text = re.sub(r'"([^;]*?)( |$)', r'"\1\2', new_text)
if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18): if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18):
new_text = re.sub(r"(http://.*?)( |$)", r'<a href="\1">\1</a>\2', new_text) new_text = re.sub(r"(http://.*?)( |$)", r'<a href="\1">\1</a>\2', new_text)
new_text = re.sub(r'@(.*?)( |$)', r'@<a href="@\1">\1</a>\2', new_text) new_text = re.sub(r'@(.*?)( |$)', r'@<a href="@\1">\1</a>\2', new_text)