scottjehl/Respond — Issue #91: Respond.js incorrectly parsing compressed CSS
Author: awaer
Created: 2012-01-11 23:35:52+00:00
State: open

I have found some issues while building a site in Drupal 6 that uses its core CSS compression in combination with Respond.

Specifically, the characters `{}` in the regular expression it uses for compression:

```php
# drupal/includes/common.inc:2030
$contents = preg_replace(
'<\s*([@{}:;,]|\)\s|\s\()\s*>S', // Remove whitespace around separators,
'\1', $contents); // but keep space around parentheses.
```

Removing the curly brackets from the original regular expression fixes the parsing issue. Conversely, parsing fails if I adjust the regular expression to strip whitespace only around curly brackets `<\s*([{}]|\)\s|\s\()\s*>S`.

Is it possible that a closing bracket next to a media query (`}@media`) could cause problems?