andrewrk / juice

Juice inlines CSS stylesheets into your HTML source.
MIT License
60 stars 13 forks source link

Add option preserveMediaQueries to complement removeStyleTags #5

Closed jrit closed 10 years ago

jrit commented 10 years ago

This adds the option and test coverage to preserve media queries for CSS inside style tags while removing the rest of the styles from the style tag. This is to resolve https://github.com/andrewrk/juice/issues/3

Based on the somewhat scattered state of the test runners, I added the tests where it made sense, so they are run with node test/run.js but had to introduce a new path that includes json format options and run through juice.JuiceContent instead of just using juice. This felt like it set things up best to add additional tests with other options in the future while keeping all existing tests they way were.

andrewrk commented 10 years ago

Looks like the tests didn't pass on Travis.

jrit commented 10 years ago

Looks like a line ending issue, that's what I get for using windows. I'll get that updated. See any other issues while I'm fixing that?

andrewrk commented 10 years ago

Seems fine to me. Want to update the README to reflect the API you added here? After that I think it should be good to merge and publish.

jrit commented 10 years ago

The readme has been updated

andrewrk commented 10 years ago

Thanks for the contribution! Released in 0.7.0