Why:
* When `removeEmpty: false` is used then comments are not properly
removed from a list of tokens.
* Fixed issue [#895](https://github.com/jakubpawlowicz/clean-css/issues/895) - ignoring specific styles.
* Fixed issue [#947](https://github.com/jakubpawlowicz/clean-css/issues/947) - selector based filtering.
+[4.1.6 / 2017-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.5...4.1)
+==================
+
+* Fixed issue [#887](https://github.com/jakubpawlowicz/clean-css/issues/887) - edge case in serializing comments.
+
[4.1.5 / 2017-06-29](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.4...v4.1.5)
==================
restoreFromOptimizing(_properties);
removeUnused(_properties);
-
- if (_properties.length != properties.length) {
- removeComments(properties, options);
- }
+ removeComments(properties, options);
}
function removeComments(tokens, options) {
break;
}
- if (levelOptions.removeEmpty && (token[1].length === 0 || (token[2] && token[2].length === 0))) {
+ if (token[0] == Token.COMMENT && token[1].length === 0 || levelOptions.removeEmpty && (token[1].length === 0 || (token[2] && token[2].length === 0))) {
tokens.splice(i, 1);
i--;
l--;
'a{/* a comment */}',
'a{}'
],
+ 'body with comment and ignored value': [
+ '.block{/* a comment */_color: red}',
+ '.block{}'
+ ],
+ 'top level comment': [
+ '/* comment */.block{}',
+ '.block{}'
+ ],
'@media query': [
'@media screen{}',
'@media screen{}'