From 5c642bd479c5a63a2c4acfdb92170d595eeae97b Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 May 2010 12:15:53 -0400 Subject: [PATCH] Fixed parsing of double-quotes in tweet text --- TODO | 1 - twitterwidgets.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO b/TODO index 638a786..ce7ff0c 100644 --- a/TODO +++ b/TODO @@ -17,4 +17,3 @@ bugs: 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. * 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 diff --git a/twitterwidgets.py b/twitterwidgets.py index a88cda2..703e92f 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -372,6 +372,7 @@ class TweetBox(gtk.HBox): # and the 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) 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'\1\2', new_text) new_text = re.sub(r'@(.*?)( |$)', r'@\1\2', new_text)