--- a/app/soc/views/helpers/template_helpers.py Sat Sep 13 21:27:17 2008 +0000
+++ b/app/soc/views/helpers/template_helpers.py Sat Sep 13 22:00:51 2008 +0000
@@ -19,6 +19,7 @@
__authors__ = [
'"Todd Larsen" <tlarsen@google.com>',
+ '"Pawel Solyga" <pawel.solyga@gmail.com>'
]
@@ -55,3 +56,13 @@
'%s/%s' % (t.rsplit('/', 1)[0], new_template_file) for t in templates]
return sibling_templates + default_template
+
+def unescape(html):
+ "Returns the given HTML with ampersands, quotes and carets decoded"
+
+ if not isinstance(html, basestring):
+ html = str(html)
+
+ html.replace('&', '&').replace('<', '<')
+ html.replace('>', '>').replace('"', '"').replace(''',"'")
+ return html