mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Textarea Field, Multiline Block (from acbart) (#2663)
* Field Textarea, text_multiline block, generators
This commit is contained in:
committed by
Sam El-Husseini
parent
f717add5a5
commit
6f4476c962
@@ -157,6 +157,20 @@ Blockly.Lua.quote_ = function(string) {
|
||||
return '\'' + string + '\'';
|
||||
};
|
||||
|
||||
/**
|
||||
* Encode a string as a properly escaped multiline Lua string, complete with
|
||||
* quotes.
|
||||
* @param {string} string Text to encode.
|
||||
* @return {string} Lua string.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Lua.multiline_quote_ = function(string) {
|
||||
string = string.replace(/\\/g, '\\\\')
|
||||
.replace(/\n/g, '\\\n')
|
||||
.replace(/'/g, '\\\'');
|
||||
return '[===' + string + '===]';
|
||||
};
|
||||
|
||||
/**
|
||||
* Common tasks for generating Lua from blocks.
|
||||
* Handles comments for the specified block and any connected value blocks.
|
||||
|
||||
Reference in New Issue
Block a user