mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Merge pull request #662 from picklesrus/develop-fix-json
Fix #643 to make exported json valid
This commit is contained in:
@@ -113,6 +113,11 @@ BlockExporterTools.prototype.getBlockDefinitions =
|
||||
}
|
||||
blockCode.push(code);
|
||||
}
|
||||
|
||||
// Surround json with [] and comma separate items.
|
||||
if (definitionFormat == "JSON") {
|
||||
return "[" + blockCode.join(",\n") + "]";
|
||||
}
|
||||
return blockCode.join("\n\n");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user