Fixed source field sometimes showing up as broken HTML...

This commit is contained in:
Anna
2010-05-23 17:58:25 -04:00
parent d7893fce37
commit 9f239e8c37
4 changed files with 9 additions and 5 deletions

View File

@ -410,8 +410,13 @@ class TweetBox(gtk.HBox):
# Set the header
if status.source is not None:
self.app_url = re.sub(r'.*<a href=\"(.*?)\".*', r'\1', status.source)
app_name = re.sub(r'.*<a.*?>(.*)</a>.*', r'\1', status.source)
source = status.source
if re.match(r'&lt;', source):
metalabel = gtk.Label()
metalabel.set_markup(status.source)
source = metalabel.get_text()
self.app_url = re.sub(r'.*<a href=\"(.*?)\".*', r'\1', source)
app_name = re.sub(r'.*<a.*?>(.*)</a>.*', r'\1', source)
self.app_button.set_label(app_name)
self.app_button.show()
self.via_label.show()