peterbe/premailer — pull request #53 by victorlin (2014-02-23 12:03:25+00:00)
Title: Bugfix media query

When you have multiple rules in media query, all rules other than the first one will be included. For example:

```html

First div

```

Because the regular expression rule `((.*?){(.*?)})`, so the match will be

```
@media print{
div {
text-align: center;
}
```

which is wrong obviously. And the following rule will be included

```
div {
font-size: 999px;
}
```

Since there is a mature CSS parser [cssutils](https://pypi.python.org/pypi/cssutils/) out there, so I can't see a reason to use regular expression for parsing CSS. Therefore, I use it to replace original regular expression manner.