remove blockly code from sumorobot object
This commit is contained in:
@@ -166,12 +166,12 @@ window.addEventListener('load', function() {
|
||||
// Otherwise when we are in Blockly mode
|
||||
} else {
|
||||
// Get the code from the blocks
|
||||
parsedCode = sumorobot.getBlocklyCode().replace(/;;.{20}/g, '');
|
||||
parsedCode = Blockly.Python.workspaceToCode(workspace).replace(/;;.{20}/g, '');
|
||||
}
|
||||
// Escape the qoutes, replace new lines and send the code
|
||||
//sumorobot.send('code', parsedCode.replace(/"/g, '\\"').replace(/\n/g, ';;'));
|
||||
// Split into lines of code and filter empty lines
|
||||
lines = sumorobot.getBlocklyCode().split('\n').filter(Boolean);
|
||||
lines = Blockly.Python.workspaceToCode(workspace).split('\n').filter(Boolean);
|
||||
// Process the code starting from the first line
|
||||
processCode(0);
|
||||
});
|
||||
|
Reference in New Issue
Block a user