Commit 68c89f4e authored by yann300's avatar yann300

lazy format to JSON

parent c0bb8038
...@@ -36,6 +36,9 @@ class BasicReadOnlyExplorer { ...@@ -36,6 +36,9 @@ class BasicReadOnlyExplorer {
} }
addReadOnly (path, content) { addReadOnly (path, content) {
try { // lazy try to format JSON
content = JSON.stringify(JSON.parse(content), null, '\t')
} catch (e) {}
this.files[this.type + '/' + path] = content this.files[this.type + '/' + path] = content
this.event.trigger('fileAdded', [this.type + '/' + path, true]) this.event.trigger('fileAdded', [this.type + '/' + path, true])
return true return true
......
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