Updated mailto: link inner title
authorThierry Florac <tflorac@ulthar.net>
Wed, 23 Jan 2019 20:16:17 +0100
changeset 1258 49da29eef086
parent 1257 6027118fcde9
child 1259 98e0cb271ae1
Updated mailto: link inner title
src/pyams_content/component/links/__init__.py
--- a/src/pyams_content/component/links/__init__.py	Wed Jan 23 19:45:27 2019 +0100
+++ b/src/pyams_content/component/links/__init__.py	Wed Jan 23 20:16:17 2019 +0100
@@ -9,11 +9,12 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from pyramid.encode import url_quote
-
 
 __docformat__ = 'restructuredtext'
 
+from html import escape
+
+from pyramid.encode import url_quote
 from zope.interface import implementer
 from zope.schema.fieldproperty import FieldProperty
 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
@@ -293,7 +294,10 @@
 
     @property
     def inner_title(self):
-        return self.context.get_url()
+        if self.context.address_name:
+            return escape('{} <{}>'.format(self.context.address_name, self.context.address))
+        else:
+            return self.context.address
 
     @property
     def human_size(self):