Utils: don't consume three backslashes at a time
This commit is contained in:
parent
06708949a1
commit
d60d595254
@ -201,8 +201,7 @@ class Utils {
|
|||||||
* Utils.parseEscapedChars("\\n");
|
* Utils.parseEscapedChars("\\n");
|
||||||
*/
|
*/
|
||||||
static parseEscapedChars(str) {
|
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, b) {
|
||||||
if (a === "\\") return "\\"+b;
|
|
||||||
switch (b[0]) {
|
switch (b[0]) {
|
||||||
case "\\":
|
case "\\":
|
||||||
return "\\";
|
return "\\";
|
||||||
|
Loading…
Reference in New Issue
Block a user