Whole file

sprymix/csscompressor

The author described this change as Fix @supports directives minification (#12). It counts as a record because the check below fails on the code as it stood at 0857438db and passes on 49d54c4f4, with nothing else changed between the two runs.

Fix saved2022-07-23
Sharing licenceBSD-3-Clause · LICENSE
Change size+4 0

What the code was meant to do, written into the code itself as a save note

Fix @supports directives minification (#12)

The change

5151 re.I | re.X)
5252
5353 _space_and_re = re.compile(r'\band\(', re.I)
54+_supports_parenthesis_re = re.compile(r'(@supports)([^{]*)', re.I)
5455
5556 _space_after_re = re.compile(r'([!{}:;>+\(\[,])\s+')
5657
389390 # Put the space back in some cases, to support stuff like
390391 # @media screen and (-webkit-min-device-pixel-ratio:0){
391392 css = _space_and_re.sub('and (', css)
393+
394+ # Put the parenthesis back on @supports directive
395+ css = _supports_parenthesis_re.sub(lambda match: match.group(1) + '(' + match.group(2) + ')', css)
392396
393397 # Remove the spaces after the things that should not have spaces after them.
394398 css = _space_after_re.sub(r'\1', css)

The check that tells the two apart

failpass·csscompressor/tests/test_other.py::Tests::test_supports_directive

Check file csscompressor/tests/test_other.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it0857438db725d5c1d2672f45d9cf3e7dc14646a4
Broken version dated2017-11-26
Modulecsscompressor.__init__
Units changed_compress
Fingerprint5b006b028e0f318f
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in sprymix/csscompressor