From 06bc31ddc5bdb4f3872bd219bcfa14ee731af564 Mon Sep 17 00:00:00 2001 From: Jarkko Ylipaavalniemi Date: Wed, 15 Mar 2017 13:45:22 +0200 Subject: [PATCH 1/2] Added whitespace handling to regexp. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 52b1ba1..63e66c7 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ module.exports = function(source) { this.cacheable && this.cacheable(); - if ((typeof source === "string") && (/^#!/.test(source))) { + if ((typeof source === "string") && (/^\s*#!/.test(source))) { source = source.replace /^#![^\n\r]*[\r\n]/, '' } return source From 2bcbe933e5ab367c7df5226abe19d39bd5bfbde0 Mon Sep 17 00:00:00 2001 From: Jarkko Ylipaavalniemi Date: Thu, 16 Mar 2017 10:14:09 +0200 Subject: [PATCH 2/2] Added whitespace in the replace regexp too. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 63e66c7..3114803 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ module.exports = function(source) { this.cacheable && this.cacheable(); if ((typeof source === "string") && (/^\s*#!/.test(source))) { - source = source.replace /^#![^\n\r]*[\r\n]/, '' + source = source.replace /^\s*#![^\n\r]*[\r\n]/, '' } return source // this.value = [value];