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