Remove multi-line comments to avoid escaping (#3231) (#3232)

Fixes #3230 by removing multi-line comments for procedures.
This commit is contained in:
RoboErikG
2019-10-14 11:22:08 -07:00
committed by GitHub
parent 31db570cd1
commit 52a6992dfc
4 changed files with 176 additions and 437 deletions

View File

@@ -253,15 +253,8 @@ Blockly.JavaScript.scrub_ = function(block, code, opt_thisOnly) {
var comment = block.getCommentText();
if (comment) {
comment = Blockly.utils.string.wrap(comment,
Blockly.JavaScript.COMMENT_WRAP - 3);
if (block.getProcedureDef) {
// Use a comment block for function comments.
commentCode += '/**\n' +
Blockly.JavaScript.prefixLines(comment + '\n', ' * ') +
' */\n';
} else {
commentCode += Blockly.JavaScript.prefixLines(comment + '\n', '// ');
}
Blockly.JavaScript.COMMENT_WRAP - 3);
commentCode += Blockly.JavaScript.prefixLines(comment + '\n', '// ');
}
// Collect comments for all value arguments.
// Don't collect comments for nested statements.