--- a/src/pyams_content/component/links/__init__.py Mon Jan 21 17:43:30 2019 +0100
+++ b/src/pyams_content/component/links/__init__.py Tue Jan 22 14:27:57 2019 +0100
@@ -9,6 +9,8 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
+from pyramid.encode import url_quote
+
__docformat__ = 'restructuredtext'
@@ -272,7 +274,10 @@
return 'mailto:{0} <{1}>'.format(self.address_name, self.address)
def get_url(self, request=None, view_name=None):
- return 'mailto:{0} <{1}>'.format(self.address_name, self.address)
+ if self.address_name:
+ return 'mailto:{}'.format(url_quote('{} <{}>'.format(self.address_name, self.address)))
+ else:
+ return 'mailto:{}'.format(self.address)
@adapter_config(context=IMailtoLink, provides=IAssociationInfo)