Textarea Field, Multiline Block (from acbart) (#2663)

* Field Textarea, text_multiline block, generators
This commit is contained in:
Rachel Fenichel
2019-09-11 17:57:46 -07:00
committed by Sam El-Husseini
parent f717add5a5
commit 6f4476c962
28 changed files with 509 additions and 48 deletions

View File

@@ -183,6 +183,20 @@ Blockly.Dart.quote_ = function(string) {
return '\'' + string + '\'';
};
/**
* Encode a string as a properly escaped multiline Dart string, complete with
* quotes.
* @param {string} string Text to encode.
* @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 + '\'\'\'';
};
/**
* Common tasks for generating Dart from blocks.
* Handles comments for the specified block and any connected value blocks.