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

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