summaryrefslogtreecommitdiff
path: root/share/www
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 /share/www
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
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/futon.format.js6
1 files changed, 5 insertions, 1 deletions
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>";