trullock / NUglify

NUglify is a HTML, JavaScript and CSS minification Library for .NET (fork of AjaxMin + new features)
Other
396 stars 79 forks source link

Multiple functions with spaces inbetween in selector not supported #280 #281

Closed pvkekem closed 3 years ago

pvkekem commented 3 years ago

The following selector now minifies correct:

:is(.container) :is(.bold) {
    font-weight: bold;
}

:is(.container) :is(.bold){font-weight: bold;}

trullock commented 3 years ago

Good find on the bug.

This change looks a bit too aggressive. Surely this will now add whitespace to many places it wasn't before, fixing the bug but reducing compression performance.

The test suite isnt necessarilly 100% complete. Those removed parentheses were in the code for a reason, can we evaluate what scenario they covered and be a bit more optimal?

pvkekem commented 3 years ago

Good call, I've reduced the change to just the closing parenthese in the space after. That solves my issue, and still passes all other tests. I've also added some more CSS to validate in the test, including some spaces, which also passes.