mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
Fix PHP multiline string
This commit is contained in:
@@ -206,8 +206,12 @@ Blockly.PHP.quote_ = function(string) {
|
|||||||
* @return {string} PHP string.
|
* @return {string} PHP string.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Blockly.PHP.multiline_quote_ = function(string) {
|
Blockly.PHP.multiline_quote_ = function (string) {
|
||||||
return '<<<EOT\n' + string + '\nEOT';
|
var lines = string.split(/\n/g).map(Blockly.PHP.quote_);
|
||||||
|
// Join with the following, plus a newline:
|
||||||
|
// . "\n" .
|
||||||
|
// Newline escaping only works in double-quoted strings.
|
||||||
|
return lines.join(' . \"\\n\" .\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user