From dfa6e66c5dac0cdf6ae50431838b7b95af30758f Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Wed, 25 Mar 2015 18:40:16 +0800 Subject: [PATCH] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 00a6d36..24f02d9 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,11 @@ var customTransform = function(file, enc, done) { if (r) { value = _.trim(r[1], '\'"'); + + // Replace double backslash with single backslash + value = value.replace(/\\\\/g, '\\'); + value = value.replace(/\\\'/, '\''); + key = hash(value); // returns a hash value as its default key parser.parse(key, value); } @@ -173,6 +178,10 @@ var customTransform = function(file, enc, done) { if ( ! _.isUndefined(r[1])) { value = _.trim(r[1], '\'"'); + + // Replace double backslash with single backslash + value = value.replace(/\\\\/g, '\\'); + value = value.replace(/\\\'/, '\''); } var params = parser.parseHashArguments(r[2]);