[2.0.6 / 2014-xx-xx (UNRELEASED)](https://github.com/GoalSmashers/clean-css/compare/v2.0.5...v2.0.6)
==================
+* Fixed issue [#198](https://github.com/GoalSmashers/clean-css/issues/198) - process comments and `@import`s correctly.
* Fixed issue [#205](https://github.com/GoalSmashers/clean-css/issues/205) - freeze on broken @import declaration.
[2.0.5 / 2014-01-03](https://github.com/GoalSmashers/clean-css/compare/v2.0.4...v2.0.5)
var commentScanner = function(data) {
var commentRegex = /(\/\*(?!\*\/)[\s\S]*?\*\/)/;
+ var lastStartIndex = 0;
var lastEndIndex = 0;
var noComments = false;
return false;
// idx can be still within last matched comment (many @import statements inside one comment)
- if (idx < lastEndIndex)
+ if (idx > lastStartIndex && idx < lastEndIndex)
return true;
comment = data.match(commentRegex);
}
// get the indexes relative to the current data chunk
- localStartIndex = comment.index;
+ lastStartIndex = localStartIndex = comment.index;
localEndIndex = localStartIndex + comment[0].length;
// calculate the indexes relative to the full original data
--- /dev/null
+@import url('./partials/one.css');
+@import url('./partials/three.css');
+/*some comment, you guys!*/
+.imports-with-comment { color: #999; }