Do not escape % in python strings. (#1982)

Rebase of PR-1890, commit 793055… from Ellipsis753:patch-1
This commit is contained in:
Andrew n marshall
2018-07-20 15:54:11 -07:00
committed by GitHub
parent 49955bd984
commit f42291ea64

View File

@@ -224,8 +224,7 @@ Blockly.Python.scrubNakedValue = function(line) {
Blockly.Python.quote_ = function(string) {
// Can't use goog.string.quote since % must also be escaped.
string = string.replace(/\\/g, '\\\\')
.replace(/\n/g, '\\\n')
.replace(/\%/g, '\\%');
.replace(/\n/g, '\\\n');
// Follow the CPython behaviour of repr() for a non-byte string.
var quote = '\'';