From: GoalSmashers Date: Sat, 3 Nov 2012 21:24:57 +0000 (+0000) Subject: Added removing comment characters inside comments. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=97f7056c3f07f8818dfd97696d7163d897527dfc;p=clean-css.git Added removing comment characters inside comments. --- diff --git a/lib/clean.js b/lib/clean.js index 1c22c0e7..f991738a 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -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; diff --git a/test/unit-test.js b/test/unit-test.js index 5370883a..f2b30f3a 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -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({