summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-06-02 18:09:43 +0000
committerJan Lehnardt <jan@apache.org>2010-06-02 18:09:43 +0000
commit85ceb17d00984b902cadc7a344f9d4adb82d50a5 (patch)
tree21a566d8674d19c46f79fc5075fb3f66f6b20716
parentfaa27f90746c436e18f9f5dfe5187143a154939f (diff)
Avoid double escaping in Futon edit fields. Patch by Martin Haaß. Closes COUCHDB-611.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950696 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--THANKS1
-rw-r--r--share/www/script/futon.format.js6
2 files changed, 6 insertions, 1 deletions
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 <jkwon.work@gmail.com>
* Gavin Sherry <swm@alcove.com.au>
* Timothy Smith <tim@couch.io>
+ * Martin Haaß <MartinHaass@gmx.net>
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 = "<code class='" + type + "'>" + retval + "</code>";