Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve unsupported media queries in head element #275

Merged
merged 7 commits into from
Nov 2, 2021

Conversation

garbidge
Copy link
Contributor

Currently, if using removeStyleElements while also having media queries in <style> in <head> which cannot be inlined, these media queries will be lost.

This adds a new parameter preserveMediaQueries which instead of removing the entire <style> node, will replace the inner styles with just the unsupported media queries

I realise you already have a a workaround for this of setting an id on the style node and using ignoreElements so feel free to close this if you would prefer to keep it as is

@martinnormark
Copy link
Contributor

Hey @sleeplessghost - thanks for submitting this.

I can see how it is useful, any chance you'd add a unit test or two to safeguard this logic going forward?

@garbidge
Copy link
Contributor Author

garbidge commented Nov 2, 2021

Sure, happy to do so

Copy link
Contributor

@martinnormark martinnormark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏻

@martinnormark martinnormark merged commit 54d6dbf into milkshakesoftware:master Nov 2, 2021
@martinnormark
Copy link
Contributor

@sleeplessghost Release to nuget https://www.nuget.org/packages/PreMailer.Net/2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants