From 85ceb17d00984b902cadc7a344f9d4adb82d50a5 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Wed, 2 Jun 2010 18:09:43 +0000 Subject: =?UTF-8?q?Avoid=20double=20escaping=20in=20Futon=20edit=20fields.?= =?UTF-8?q?=20Patch=20by=20Martin=20Haa=C3=9F.=20Closes=20COUCHDB-611.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950696 13f79535-47bb-0310-9956-ffa450edef68 --- THANKS | 1 + share/www/script/futon.format.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/THANKS b/THANKS index ad5104b7..9c02e64d 100644 --- a/THANKS +++ b/THANKS @@ -56,5 +56,6 @@ suggesting improvements or submitting changes. Some of these people are: * Jae Kwon * Gavin Sherry * Timothy Smith + * Martin Haaß For a list of authors see the `AUTHORS` file. diff --git a/share/www/script/futon.format.js b/share/www/script/futon.format.js index 5feee817..e2eb0593 100644 --- a/share/www/script/futon.format.js +++ b/share/www/script/futon.format.js @@ -44,7 +44,11 @@ if (type == "string" && !options.escapeStrings) { retval = indentLines(retval.replace(/\r\n/g, "\n"), tab.substr(options.indent)); } else { - retval = escape(JSON.stringify(val)); + if (options.html) { + retval = escape(JSON.stringify(val)); + } else { + retval = JSON.stringify(val); + } } if (options.html) { retval = "" + retval + ""; -- cgit v1.2.3