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

Don't enable options by default #30

Open
MSch opened this issue Mar 12, 2015 · 4 comments · Fixed by paolochiodi/htmlcompressor#26
Open

Don't enable options by default #30

MSch opened this issue Mar 12, 2015 · 4 comments · Fixed by paolochiodi/htmlcompressor#26

Comments

@MSch
Copy link

MSch commented Mar 12, 2015

Just got hit by #24 because I expected no potentially unsafe options to be enabled by default.

Furthermore the https://github.com/paolochiodi/htmlcompressor#usage documentation has different "basic and safe default options" than middleman-minify-html

@tdreyno
Copy link
Member

tdreyno commented Mar 12, 2015

Can you explain further?

@MSch
Copy link
Author

MSch commented Mar 12, 2015

Yes, I turned on minify_html, enabling remove_comments, expecting this to only remove comments not perform other, potentially unsafe, actions.

The htmlcompressor project by default does not enable any options for precisely this reason.

middleman-minify-html does enable options by default which do break websites.

@rmoriz
Copy link

rmoriz commented Mar 12, 2015

It removes the http://-protocol part in every outgoing link by default.
When you deploy your middleman site on https with minify-html enabled, all http-only links will break.

see:

=> go to https://middlemanapp.com/
=> click on "Thomas Reynolds" (near the footer)

=> no protocol specified
=> https assumed (like https://middlemanapp.com/)
=> but https not configured (in your case a wrong certificate warning)

Update:
Okay looks like in the case of https://middlemanapp.com/ it's caused manually in https://github.com/middleman/middleman-guides/blob/master/source/localizable/_footer.html.erb however minify-html does this automatically by default and would have broken the link the same way

@Arcovion
Copy link
Contributor

Further down in their readme is:

The middleware uses a little more aggressive options by default:

Those are the defaults we're using, so please let https://github.com/paolochiodi/htmlcompressor know about this too.

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 a pull request may close this issue.

4 participants