mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Fix python multiline string
This commit is contained in:
@@ -234,9 +234,10 @@ Blockly.Python.quote_ = function(string) {
|
||||
* @private
|
||||
*/
|
||||
Blockly.Python.multiline_quote_ = function(string) {
|
||||
// Can't use goog.string.quote since % must also be escaped.
|
||||
string = string.replace(/'''/g, '\\\'\\\'\\\'');
|
||||
return '\'\'\'' + string + '\'\'\'';
|
||||
var lines = string.split(/\n/g).map(Blockly.Python.quote_);
|
||||
// Join with the following, plus a newline:
|
||||
// + '\n' +
|
||||
return lines.join(' + \'\\n\' + \n');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user