From c502dfbbfbee49c15ce4a57f7d417b71a73a10b6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 14 Jun 2013 00:05:09 +0100 Subject: [PATCH] Changed |tojson filter to quote single attributes --- CHANGES | 5 +++++ flask/json.py | 19 +++++++++++++++++-- flask/testsuite/helpers.py | 6 ++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5b4e2b8f..86b006b8 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,11 @@ Version 0.10.1 Pending bugfix release. +- Fixed an issue where ``|tojson`` was not quoting single quotes which + made the filter not work properly in HTML attributes. Now it's + possible to use that filter in single quoted attributes. This should + make using that filter with angular.js easier. + Version 0.10 ------------ diff --git a/flask/json.py b/flask/json.py index d1cda5ae..45ba3240 100644 --- a/flask/json.py +++ b/flask/json.py @@ -165,14 +165,29 @@ def htmlsafe_dumps(obj, **kwargs): also mark the result as safe. Due to how this function escapes certain characters this is safe even if used outside of ``