From 133172ba8823c689bdfa529ff02c5e2c72fca2a4 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Mon, 29 Oct 2012 14:54:17 +0100 Subject: Escape @-signs --- hyperkitty/templates/month_view.html | 4 ++-- hyperkitty/templatetags/hk_generic.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'hyperkitty') diff --git a/hyperkitty/templates/month_view.html b/hyperkitty/templates/month_view.html index 9f3a857..00b7a96 100644 --- a/hyperkitty/templates/month_view.html +++ b/hyperkitty/templates/month_view.html @@ -8,7 +8,7 @@
-
{{ mlist.display_name|default:mlist.name }}
+
{{ mlist.display_name|default:mlist.name|escapeatsign }}
{{ month|date:"F Y"|capfirst }}
  • @@ -20,7 +20,7 @@
{% if mlist.display_name %}

- {{ list_address }} + {{ list_address|escapeatsign }}

{% endif %}
diff --git a/hyperkitty/templatetags/hk_generic.py b/hyperkitty/templatetags/hk_generic.py index 5f30bc2..d7e3d2c 100644 --- a/hyperkitty/templatetags/hk_generic.py +++ b/hyperkitty/templatetags/hk_generic.py @@ -90,3 +90,10 @@ def truncatesmart(value, limit=80): # Join the words and return return ' '.join(words) + '...' + + +@register.filter(is_safe=True) +def escapeatsign(text): + """To escape email addresses""" + return text.replace("@", u"\uff20") + -- cgit