Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
2c19b398
Commit
2c19b398
authored
Aug 25, 2015
by
Amanda Ghassaei
Browse files
add quotes back to saved json
parent
70b5ca46
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/models/FileSaver.js
View file @
2c19b398
...
...
@@ -10,8 +10,8 @@ define(['underscore', 'fileSaverLib', 'lattice', 'materials', 'ribbon', 'menuWra
// console.log(data.toString());
var
jsonString
=
JSON
.
stringify
(
data
,
null
,
'
\t
'
);
if
(
data
.
assembler
){
jsonString
.
replace
(
/
\\
"/g
,
"
\
uFFFF
"
);
//U+ FFFF
jsonString
=
jsonString
.
replace
(
/
\"([^
"
]
+
)\"
:/g
,
"
$1:
"
).
replace
(
/
\u
FFFF/g
,
"
\\\"
"
);
//
jsonString.replace(/\\"/g,"\uFFFF"); //U+ FFFF
//
jsonString = jsonString.replace(/\"([^"]+)\":/g,"$1:").replace(/\uFFFF/g,"\\\"");
}
var
blob
=
new
Blob
([
jsonString
],
{
type
:
"
text/plain;charset=utf-8
"
});
saveAs
(
blob
,
name
+
extension
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment