couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Haaß (JIRA) <j...@apache.org>
Subject [jira] Commented: (COUCHDB-611) Double-escaping of ampersands when editing in Futon
Date Tue, 20 Apr 2010 10:55:50 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858814#action_12858814
] 

Martin Haaß commented on COUCHDB-611:
-------------------------------------

proposed patch to remove the endless escaping nightmare:
Index: futon.format.js
===================================================================
--- futon.format.js     (revision 935857)
+++ futon.format.js     (working copy)
@@ -44,7 +44,10 @@
             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>";


> Double-escaping of ampersands when editing in Futon
> ---------------------------------------------------
>
>                 Key: COUCHDB-611
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-611
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Futon
>         Environment: Safari 4.0.4 or Firefox 3.6b5
>            Reporter: Jason Davies
>
> To reproduce, create a new document in Futon and add a test field with the value ["&"].
Click the green tick button to apply and then edit the value again, and now it will show ["&amp;"].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message