fix sending code to sumorobot

This commit is contained in:
Silver Kuusik 2018-08-17 19:51:10 +02:00
parent a80cc89403
commit ec2e6f41ac

View File

@ -175,7 +175,7 @@ window.addEventListener('load', function() {
parsedCode = Blockly.Python.workspaceToCode(workspace).replace(/;;.{20}/g, ''); parsedCode = Blockly.Python.workspaceToCode(workspace).replace(/;;.{20}/g, '');
} }
// Escape the qoutes, replace new lines and send the code // Escape the qoutes, replace new lines and send the code
//sumorobot.send('code', parsedCode.replace(/"/g, '\\"').replace(/\n/g, ';;')); sumorobot.send('code', parsedCode.replace(/"/g, '\\"').replace(/\n/g, ';;'));
// Split into lines of code and filter empty lines // Split into lines of code and filter empty lines
lines = Blockly.Python.workspaceToCode(workspace).split('\n').filter(Boolean); lines = Blockly.Python.workspaceToCode(workspace).split('\n').filter(Boolean);
// Process the code starting from the first line // Process the code starting from the first line