dwightjack / grunt-premailer

Grunt wrapper task for Premailer
MIT License
114 stars 16 forks source link

Wrong argument passed to premailer #4

Closed cdarken closed 10 years ago

cdarken commented 10 years ago

When I activate verbose, I see this when calling the task:

Processing in html mode with options {:base_url=>nil, :link_query_string=>nil, :remove_classes=>true, :remove_comments=>"--line-length", :verbose=>true, :line_length=>65, :preserve_styles=>false}

Notice :remove_comments=>"--line-length"

That appears if I set removeComments to true. If I set it explicitly to false, the value is false.

Great job on these tools, found about them today and they helped a lot.

cdarken commented 10 years ago

Found it! After much poking around (good thing, because I got to remember a bit of ruby), I found the cause of the problem. At line 58 in lib/premailer.rb

opts.on("--remove-comments ", "Remove HTML comments") do |v|

there was a space after --remove-comments. If you remove it, the args are parsed correctly.

dwightjack commented 10 years ago

Hi thanks for contributing.

Fixed in release 0.2.1.

cdarken commented 10 years ago

Glad to be able to help.