So we shared `token` variable among more than one context, which was
causing issues when removing empty elements.
* Fixed issue [#517](https://github.com/jakubpawlowicz/clean-css/issues/517) - turning off color optimizations.
* Fixed issue [#542](https://github.com/jakubpawlowicz/clean-css/issues/542) - space after closing brace in IE.
+[3.2.10 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.9...3.2)
+==================
+
+* Fixed issue [#572](https://github.com/jakubpawlowicz/clean-css/issues/572) - empty elements removal.
+
[3.2.9 / 2015-05-08](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.8...v3.2.9)
==================
var ie7Hack = options.compatibility.selectors.ie7Hack;
var adjacentSpace = options.compatibility.selectors.adjacentSpace;
var spaceAfterClosingBrace = options.compatibility.properties.spaceAfterClosingBrace;
- var token;
function _cleanupCharsets(tokens) {
for (var i = 0, l = tokens.length; i < l; i++) {
- token = tokens[i];
+ var token = tokens[i];
if (token[0] != 'at-rule')
continue;
var mayHaveCharset = false;
for (var i = 0, l = tokens.length; i < l; i++) {
- token = tokens[i];
+ var token = tokens[i];
switch (token[0]) {
case 'selector':
'get merged': function(minified) {
assert.equal(minified.styles, '@font-face{font-family:A}@font-face{font-family:B}');
}
+ },
+ 'with empty selector': {
+ 'topic': function () {
+ return new CleanCSS().minify('@media screen{a{color:red}div{}}');
+ },
+ 'get merged': function(minified) {
+ assert.equal(minified.styles, '@media screen{a{color:red}}');
+ }
}
})
.addBatch({