From 9c396544799dbdaf3434be6a0c63827dab535a7f Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 20 Dec 2009 22:29:31 -0200 Subject: [PATCH] Reading the pango docs, I found the proper way to escape special chars --- mitterlib/ui/ui_pygtk.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 9cd0099..18d6789 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -29,9 +29,10 @@ import re import urllib2 import webbrowser +from cgi import escape as html_escape + from mitterlib.ui.helpers.image_helpers import find_image from mitterlib import htmlize - from mitterlib.constants import gpl_3, version from mitterlib.ui.helpers import timesince @@ -578,9 +579,7 @@ class Interface(object): time = timesince.timesince(data.message_time) # unescape escaped entities that pango is not okay with - message = re.sub(r'&', r'&', message) - message = re.sub(r'<', r'<', message) - message = re.sub(r'>', r'>', message) + message = html_escape(message) # highlight URLs mask = r'\1' % (