From f22211ce8c804aea3826059be66937eec23a2a0e Mon Sep 17 00:00:00 2001 From: n1474335 Date: Fri, 28 Jun 2019 17:13:54 +0100 Subject: [PATCH] Backslashes are now escaped correctly by 'Unescape string'. CLoses #582 --- src/core/Utils.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index 273eca1e..fed67553 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -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":