diff --git a/lib/parseValues.js b/lib/parseValues.js index eb55a07..3a7f068 100644 --- a/lib/parseValues.js +++ b/lib/parseValues.js @@ -23,7 +23,7 @@ function endSpacingMatch(match) { } function unescapeString(content) { - return content.replace(/\\([a-fA-F0-9]{4}|.)/g, function(escaped) { + return content.replace(/\\([a-fA-F0-9]{4}|[a-fA-F0-9]{2}|.)/g, function(escaped) { if(escaped.length > 2) { return String.fromCharCode(parseInt(escaped.substr(1), 16)); } else { diff --git a/test/test-cases-values.js b/test/test-cases-values.js index a8cbb88..6dc3d7b 100644 --- a/test/test-cases-values.js +++ b/test/test-cases-values.js @@ -136,6 +136,12 @@ module.exports = { { type: "string", stringType: "\"", value: "\uf0e3\\'\"" } ]) ], + "escaped unicode 3": [ + "\"\\2a\\\\'\\\"\"", + singleValue([ + { type: "string", stringType: "\"", value: "\u002a\\'\"" } + ]) + ], "nested-item-with append": [ "linear-gradient(45deg) 25%", singleValue([