Browse Source

Reading the pango docs, I found the proper way to escape special chars

master
Julio Biason 15 years ago
parent
commit
9c39654479
  1. 7
      mitterlib/ui/ui_pygtk.py

7
mitterlib/ui/ui_pygtk.py

@ -29,9 +29,10 @@ import re
import urllib2 import urllib2
import webbrowser import webbrowser
from cgi import escape as html_escape
from mitterlib.ui.helpers.image_helpers import find_image from mitterlib.ui.helpers.image_helpers import find_image
from mitterlib import htmlize from mitterlib import htmlize
from mitterlib.constants import gpl_3, version from mitterlib.constants import gpl_3, version
from mitterlib.ui.helpers import timesince from mitterlib.ui.helpers import timesince
@ -578,9 +579,7 @@ class Interface(object):
time = timesince.timesince(data.message_time) time = timesince.timesince(data.message_time)
# unescape escaped entities that pango is not okay with # unescape escaped entities that pango is not okay with
message = re.sub(r'&', r'&', message) message = html_escape(message)
message = re.sub(r'<', r'&lt;', message)
message = re.sub(r'>', r'&gt;', message)
# highlight URLs # highlight URLs
mask = r'<span foreground="%s">\1</span>' % ( mask = r'<span foreground="%s">\1</span>' % (

Loading…
Cancel
Save