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