common/uilib.py
changeset 362 a6a319f000c3
parent 350 f34ef2c64605
child 525 bd4e03297cf0
--- a/common/uilib.py	Wed Jan 07 11:36:16 2009 -0800
+++ b/common/uilib.py	Thu Jan 08 09:48:44 2009 +0100
@@ -15,7 +15,6 @@
 import re
 from urllib import quote as urlquote
 from cStringIO import StringIO
-from xml.sax.saxutils import unescape
 from copy import deepcopy
 
 import simplejson
@@ -23,7 +22,7 @@
 from mx.DateTime import DateTimeType, DateTimeDeltaType
 
 from logilab.common.textutils import unormalize
-from logilab.mtconverter import html_escape
+from logilab.mtconverter import html_escape, html_unescape
 
 def ustrftime(date, fmt='%Y-%m-%d'):
     """like strftime, but returns a unicode string instead of an encoded
@@ -117,7 +116,7 @@
     tags from given text if cut is necessary."""
     if text is None:
         return u''
-    noenttext = unescape(text)
+    noenttext = html_unescape(text)
     text_nohtml = remove_html_tags(noenttext)
     # try to keep html tags if text is short enough
     if len(text_nohtml) <= length: