Backslashes are now escaped correctly by 'Unescape string'. CLoses #582

This commit is contained in:
n1474335 2019-06-28 17:13:54 +01:00
parent f9c24f2528
commit f22211ce8c
1 changed files with 3 additions and 1 deletions

View File

@ -201,9 +201,11 @@ class Utils {
* Utils.parseEscapedChars("\\n");
*/
static parseEscapedChars(str) {
return str.replace(/(\\)?\\([bfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\})/g, function(m, a, b) {
return str.replace(/(\\)?\\([bfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g, function(m, a, b) {
if (a === "\\") return "\\"+b;
switch (b[0]) {
case "\\":
return "\\";
case "0":
case "1":
case "2":