From a6b2b4981c4bf78c023d9b5cb94159cd20d03672 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 16 Jun 2006 02:36:18 -0400 Subject: [PATCH] More unescaping... --- sugar/shell/StartPage.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sugar/shell/StartPage.py b/sugar/shell/StartPage.py index 1a388cd1..890b3cb6 100644 --- a/sugar/shell/StartPage.py +++ b/sugar/shell/StartPage.py @@ -5,6 +5,7 @@ import pango import dbus import cgi import urllib +import re import google from sugar.presence.PresenceService import PresenceService @@ -46,8 +47,8 @@ class ActivitiesView(gtk.TreeView): if subtitle is None: subtitle = model.get_value(it, 1) - markup = '' + title + '' + '\n' + subtitle - markup = cgi.escape(markup) # escape the markup + markup = '' + cgi.escape(title) + '' + markup += '\n' + cgi.escape(subtitle) cell.set_property('markup', markup) cell.set_property('ellipsize', pango.ELLIPSIZE_END) @@ -138,5 +139,16 @@ class StartPage(gtk.HBox): model = ActivitiesModel() for result in data.results: - model.add_web_page(result.title, result.URL) + title = result.title + + # FIXME what tags should we actually strip? + title = title.replace('', '') + title = title.replace('', '') + + # FIXME I'm sure there is a better way to + # unescape these. + title = title.replace('"', '"') + title = title.replace('&', '&') + + model.add_web_page(title, result.URL) self._activities.set_model(model)