premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

Normalize whitespace in selectors and queries #74

Closed martent closed 8 years ago

martent commented 8 years ago

Extra whitespace in form of multiple spaces, tabs, line feeds, carriage returns and form feeds within CSS selectors and in queries might not be a beauty. But as I understand the spec, multiple elements within a selector should be "whitespace-separated", and it includes all those kinds of whitespaces. ¹

This topic branched pull request adds tests and support for both selectors and queries with extra whitespace by normalizing it.

[1]: https://www.w3.org/TR/css3-selectors/#selector-syntax

grosser commented 8 years ago

a little sad we have to do all this extra logic, but I guess it makes sense ...

martent commented 8 years ago

Maybe more of a refined pattern parsing than any extra logic.