changeset 1145:5421be737643

Simplify string escaping filter.
author Sam Toyer <samATqxcvDOTnet>
date Fri, 09 Dec 2011 20:19:09 +1000
parents 9ab81e421631
children 4b68cc7e0d9c
files MoinMoin/themes/__init__.py
diffstat 1 files changed, 1 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Fri Dec 09 11:16:16 2011 +1000
+++ b/MoinMoin/themes/__init__.py	Fri Dec 09 20:19:09 2011 +1000
@@ -338,16 +338,6 @@
         result['email'] = email
     return result
 
-def json_dumps(data):
-    """
-    Escape the given string so it is safe to use as a Javscript string
-
-    :param data: string to be escaped
-    :rtype: str
-    :returns: Javascript escaped version
-    """
-    return dumps(data)
-
 def shorten_item_name(name, length=25):
     """
     Shorten item names
@@ -421,7 +411,7 @@
     app.jinja_env.filters['shorten_item_name'] = shorten_item_name
     app.jinja_env.filters['shorten_id'] = shorten_id
     app.jinja_env.filters['contenttype_to_class'] = contenttype_to_class
-    app.jinja_env.filters['json_dumps'] = json_dumps
+    app.jinja_env.filters['json_dumps'] = dumps
     # please note that these filters are installed by flask-babel:
     # datetimeformat, dateformat, timeformat, timedeltaformat