More unescaping...
This commit is contained in:
parent
7eeb43b98a
commit
a6b2b4981c
@ -5,6 +5,7 @@ import pango
|
|||||||
import dbus
|
import dbus
|
||||||
import cgi
|
import cgi
|
||||||
import urllib
|
import urllib
|
||||||
|
import re
|
||||||
|
|
||||||
import google
|
import google
|
||||||
from sugar.presence.PresenceService import PresenceService
|
from sugar.presence.PresenceService import PresenceService
|
||||||
@ -46,8 +47,8 @@ class ActivitiesView(gtk.TreeView):
|
|||||||
if subtitle is None:
|
if subtitle is None:
|
||||||
subtitle = model.get_value(it, 1)
|
subtitle = model.get_value(it, 1)
|
||||||
|
|
||||||
markup = '<big><b>' + title + '</b></big>' + '\n' + subtitle
|
markup = '<big><b>' + cgi.escape(title) + '</b></big>'
|
||||||
markup = cgi.escape(markup) # escape the markup
|
markup += '\n' + cgi.escape(subtitle)
|
||||||
|
|
||||||
cell.set_property('markup', markup)
|
cell.set_property('markup', markup)
|
||||||
cell.set_property('ellipsize', pango.ELLIPSIZE_END)
|
cell.set_property('ellipsize', pango.ELLIPSIZE_END)
|
||||||
@ -138,5 +139,16 @@ class StartPage(gtk.HBox):
|
|||||||
|
|
||||||
model = ActivitiesModel()
|
model = ActivitiesModel()
|
||||||
for result in data.results:
|
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('<b>', '')
|
||||||
|
title = title.replace('</b>', '')
|
||||||
|
|
||||||
|
# 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)
|
self._activities.set_model(model)
|
||||||
|
Loading…
Reference in New Issue
Block a user