# HG changeset patch # User Nicolas Chauvat <nicolas.chauvat@logilab.fr> # Date 1279517586 -7200 # Mon Jul 19 07:33:06 2010 +0200 # Node ID cac65e37cf6f85cb87ca0d4010869f4ba442ea54 # Parent 46264cc2e0a0a1c4d5bc907b94ac733ea9cdf58c [views] bugfix html_escape is now xml_escape diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -7,7 +7,7 @@ __docformat__ = "restructuredtext en" _ = unicode -from logilab.mtconverter import html_escape +from logilab.mtconverter import xml_escape from cubicweb.selectors import is_instance from cubicweb.view import EntityView @@ -27,8 +27,8 @@ show_attr_label = False def render_entity_title(self, entity): - title = u'<a href="%s">%s</a>' % (html_escape(entity.actual_url()), - html_escape(entity.title)) + title = u'<a href="%s">%s</a>' % (xml_escape(entity.actual_url()), + xml_escape(entity.title)) self.w(u'<h1><span class="etype">%s</span> %s</h1>' % (entity.dc_type().capitalize(), title)) @@ -43,14 +43,14 @@ entity = self.cw_rset.complete_entity(row, col) descr = entity.printable_value('description', format='text/plain') descr = descr and descr.splitlines()[0] - values = {'title': html_escape(entity.title), - 'url': html_escape(entity.absolute_url()), - 'description': html_escape(descr), + values = {'title': xml_escape(entity.title), + 'url': xml_escape(entity.absolute_url()), + 'description': xml_escape(descr), } self.w(u'<a href="%(url)s" title="%(description)s">%(title)s</a>' % values) self.w(u' [<a href="%s">%s</a>]' - % (html_escape(entity.actual_url()), + % (xml_escape(entity.actual_url()), self._cw._('follow'))) @@ -61,9 +61,9 @@ def cell_call(self, row, col): entity = self.cw_rset.complete_entity(row, col) - values = {'title': html_escape(entity.title), - 'url': html_escape(entity.actual_url()), - 'description': html_escape(entity.printable_value('description')), + values = {'title': xml_escape(entity.title), + 'url': xml_escape(entity.actual_url()), + 'description': xml_escape(entity.printable_value('description')), } self.w(u'<a href="%(url)s" title="%(description)s">%(title)s</a>' % values)