app/soc/views/helpers/template_helpers.py
changeset 141 e120c24b89e2
parent 125 155f43a0fa68
child 168 87296bdfc9c6
--- 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('&amp;', '&').replace('&lt;', '<')
+  html.replace('&gt;', '>').replace('&quot;', '"').replace('&#39;',"'")
+  return html