{ "id": "111508", "key": "ALOY-578", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-03-22T12:26:46.000+0000", "created": "2013-03-21T21:08:15.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "defect" ], "versions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-22T13:23:11.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "A had a string literal that contains escaped quotes:\r\n\r\nvar JSONtest = JSON.parse('{\"result\": \"{\\\"Xzibit\\\":{\\\"JSON\\\":\\\"within JSON\\\"}}\", \"id\": \"7ca16380-56c5-49d4-bfb3-55d8c8f9177e\" }');\r\n\r\nWhen the parser parsed it, it replaced the single-quotes with double quotes, and escape the qouble-quotes that weren't already escaped, but didn't escape the escaping of the already escaped quotes.\r\n\r\nThe resources version of the code was this:\r\n\r\nvar JSONtest = JSON.parse(\"{\\\"result\\\": \\\"{\\\"Xzibit\\\":{\\\"JSON\\\":\\\"within JSON\\\"}}\\\", \\\"id\\\": \\\"7ca16380-56c5-49d4-bfb3-55d8c8f9177e\\\" }\");\r\n\r\nwhen it should have been this (note some places have three backslashes):\r\n\r\nvar JSONtest = JSON.parse(\"{\\\"result\\\": \\\"{\\\\\\\"Xzibit\\\\\\\":{\\\\\\\"JSON\\\":\\\\\\\"within JSON\\\\\\\"}}\\\", \\\"id\\\": \\\"7ca16380-56c5-49d4-bfb3-55d8c8f9177e\\\" }\");\r\n\r\nMarking as minor as (a) There is a workaround, and (b) this code only written to test another issue with my code.\r\n", "attachment": [], "flagged": false, "summary": "Minify doesn't handle already-escaped quotes correctly", "creator": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "243532", "author": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "body": "I need to withdraw this -- if I recall correctly in js \" is meant to be equivalent to \\\" when inside single quotes", "updateAuthor": { "name": "twilkinson", "key": "twilkinson", "displayName": "Thomas Wilkinson", "active": true, "timeZone": "America/Chicago" }, "created": "2013-03-21T21:13:15.000+0000", "updated": "2013-03-21T21:14:20.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }