From b7378a18a02f1d38dc0922339aa707f03a67f751 Mon Sep 17 00:00:00 2001 From: Keith Clark Date: Tue, 17 May 2011 23:17:49 +0100 Subject: [PATCH] Stopped RE_COMMENT from greedily collecting whitespace after a comment (Fixes comments between @import rules bug) Incremented version number. --- changelog.txt | 4 ++-- selectivizr.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1d1897b..ca413b0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,8 +4,8 @@ selectivizr - change log Current Build ------------- - * NEW - selectivizr now honours media specific @imports in style sheets - + * NEW - selectivizr now honours media specific @imports in style sheets. + * BUG - comments placed between @import rules caused the import to fail. v1.0.2 diff --git a/selectivizr.js b/selectivizr.js index 7a1c80a..20dedde 100644 --- a/selectivizr.js +++ b/selectivizr.js @@ -1,5 +1,5 @@ /* -selectivizr v1.0.2b - (c) Keith Clark, freely distributable under the terms +selectivizr v1.0.3b - (c) Keith Clark, freely distributable under the terms of the MIT license. selectivizr.com @@ -67,7 +67,7 @@ References: var namespace = "slvzr"; // Stylesheet parsing regexp's - var RE_COMMENT = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g; + var RE_COMMENT = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*?/g; var RE_IMPORT = /@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))\s*([^;]*);/g; var RE_ASSET_URL = /\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g; var RE_PSEUDO_STRUCTURAL = /^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/;