Follow up to #86 - removing extra space after removed comment.
authorGoalSmashers <jakub@goalsmashers.com>
Sat, 30 Mar 2013 16:02:57 +0000 (17:02 +0100)
committerGoalSmashers <jakub@goalsmashers.com>
Sat, 30 Mar 2013 16:02:57 +0000 (17:02 +0100)
lib/clean.js
test/unit-test.js

index c40642f..719864d 100644 (file)
@@ -322,7 +322,7 @@ var CleanCSS = {
 
     var specialCommentsCount = context.specialComments.length;
     var breakSuffix = options.keepBreaks ? lineBreak : '';
-    replace(new RegExp('__CSSCOMMENT__(' + lineBreak + ')?', 'g'), function() {
+    replace(new RegExp('__CSSCOMMENT__(' + lineBreak + ')?', 'g'), function() {
       switch (options.keepSpecialComments) {
         case '*':
           return context.specialComments.shift() + breakSuffix;
index 6de079d..67d1227 100644 (file)
@@ -238,6 +238,10 @@ vows.describe('clean-units').addBatch({
     'strip all': [
       '/*! important comment */a{color:red}/* some comment *//*! important comment */',
       'a{color:red}'
+    ],
+    'move charset before': [
+      "/*! some comment */" + lineBreak + lineBreak + "@charset 'utf-8';" + lineBreak + lineBreak + "a{}",
+      "@charset 'utf-8';a{}"
     ]
   }, { keepSpecialComments: 0 }),
   'text content': cssContext({