Commit 2c19b398 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

add quotes back to saved json

parent 70b5ca46
...@@ -10,8 +10,8 @@ define(['underscore', 'fileSaverLib', 'lattice', 'materials', 'ribbon', 'menuWra ...@@ -10,8 +10,8 @@ define(['underscore', 'fileSaverLib', 'lattice', 'materials', 'ribbon', 'menuWra
// console.log(data.toString()); // console.log(data.toString());
var jsonString = JSON.stringify(data, null, '\t'); var jsonString = JSON.stringify(data, null, '\t');
if (data.assembler){ if (data.assembler){
jsonString.replace(/\\"/g,"\uFFFF"); //U+ FFFF // jsonString.replace(/\\"/g,"\uFFFF"); //U+ FFFF
jsonString = jsonString.replace(/\"([^"]+)\":/g,"$1:").replace(/\uFFFF/g,"\\\""); // jsonString = jsonString.replace(/\"([^"]+)\":/g,"$1:").replace(/\uFFFF/g,"\\\"");
} }
var blob = new Blob([jsonString], {type: "text/plain;charset=utf-8"}); var blob = new Blob([jsonString], {type: "text/plain;charset=utf-8"});
saveAs(blob, name + extension); saveAs(blob, name + extension);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment