mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
chore(generators): Don't add unnecessary escapes (#6161)
Closure Compiler was complaining about unnecessary backslashes in template literals, so remove them.
This commit is contained in:
committed by
GitHub
parent
91b570ace5
commit
3e19aded39
@@ -356,7 +356,7 @@ JavaScript['text_replace'] = function(block) {
|
||||
function ${JavaScript.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
||||
needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')
|
||||
.replace(/\\x08/g, '\\\\x08');
|
||||
return haystack.replace(new RegExp(needle, \'g\'), replacement);
|
||||
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
||||
}
|
||||
`);
|
||||
const code = functionName + '(' + text + ', ' + from + ', ' + to + ')';
|
||||
|
||||
Reference in New Issue
Block a user