diff --git a/core/generator.js b/core/generator.js index cba266f27..81feb8f78 100644 --- a/core/generator.js +++ b/core/generator.js @@ -366,7 +366,7 @@ Blockly.Generator.prototype.provideFunction_ = function(desiredName, code) { var oldCodeText; while (oldCodeText != codeText) { oldCodeText = codeText; - codeText = codeText.replace(/^(( )*) /gm, '$1\0'); + codeText = codeText.replace(/^(( {2})*) {2}/gm, '$1\0'); } codeText = codeText.replace(/\0/g, this.INDENT); this.definitions_[desiredName] = codeText;