Added removing comment characters inside comments.
authorGoalSmashers <jakub@goalsmashers.com>
Sat, 3 Nov 2012 21:24:57 +0000 (21:24 +0000)
committerGoalSmashers <jakub@goalsmashers.com>
Sat, 3 Nov 2012 21:24:57 +0000 (21:24 +0000)
lib/clean.js
test/unit-test.js

index 1c22c0e..f991738 100644 (file)
@@ -213,7 +213,7 @@ var CleanCSS = {
 
     for (; nextEnd < data.length; ) {
       nextStart = data.indexOf('/*', nextEnd);
-      nextEnd = data.indexOf('*/', nextStart);
+      nextEnd = data.indexOf('*/', nextStart + 2);
       if (nextStart == -1 || nextEnd == -1)
         break;
 
index 5370883..f2b30f3 100644 (file)
@@ -171,6 +171,10 @@ vows.describe('clean-units').addBatch({
     'should keep exact structure': [
       '/*!  \n  a > span { } with some content */',
       '/*!  \n  a > span { } with some content */'
+    ],
+    'should remove comments with forward slashes inside': [
+      '/*////*/a{color:red}',
+      'a{color:red}'
     ]
   }),
   'important comments - one': cssContext({