Fix lua multiline quote

This commit is contained in:
Rachel Fenichel
2020-09-18 11:02:17 -07:00
parent 2523da5332
commit 773a4430e7

View File

@@ -151,10 +151,10 @@ Blockly.Lua.quote_ = function(string) {
* @private
*/
Blockly.Lua.multiline_quote_ = function(string) {
string = string.replace(/\\/g, '\\\\')
.replace(/\n/g, '\\\n')
.replace(/'/g, '\\\'');
return '[===' + string + '===]';
var lines = string.split(/\n/g).map(Blockly.Lua.quote_);
// Join with the following, plus a newline:
// .. '\n' ..
return lines.join(' .. \'\\n\' ..\n');
};
/**