Fix PHP multiline string

This commit is contained in:
Rachel Fenichel
2020-09-18 13:27:04 -07:00
parent 436cfd7d73
commit 7da8d4abfe

View File

@@ -207,7 +207,11 @@ Blockly.PHP.quote_ = function(string) {
* @private
*/
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');
};
/**