dwightjack / grunt-premailer

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

Impossible to set escapeUrlAttributes to false #32

Closed luizotcarvalho closed 8 years ago

luizotcarvalho commented 9 years ago

I'm trying to set escapeUrlAttributes as false in options but when it pass to premailer gem, this option disappear and is set as true by premailer.

Config:

emails: {
        options: {
            css: [
                '/static/css/emails.css',
            ],
            removeComments: true,
            removeClasses: true,
            escapeUrlAttributes: false,
            verbose: true,
        },
        files: [... ],
 }

Args that premailer receive:

[ '--css=src/plugins/web/static/css/emails.css',
  '--remove-classes',
  '--remove-comments',
  '--line-length=65',
  '--verbose',
  '--mode=html',
  '--warn-level=1' ]

Args that premailer process:

Processing in html mode with options {:base_url=>nil, :link_query_string=>nil, :remove_classes=>true, :remove_scripts=>false, :remove_comments=>true, :verbose=>true, :line_length=>65, :preserve_styles=>false, :escape_url_attributes=>true, :replace_html_entities=>false, :remove_ids=>false, :css=>["src/plugins/web/static/css/emails.css"], :warn_level=>1}

I think thats a error when handling the options, the falsy options cannot be removed from args.

(sry for the bad inglish)

dwightjack commented 9 years ago

Hi,

not really a bug. At the moment there's a limited number of option you can pass to premailer with this task and escapeUrlAttributes is not one of them.

There's another issue (https://github.com/dwightjack/grunt-premailer/issues/34) related to this. I'm not skilled in ruby, so if you know how to solve the problem feel free to contribute or point documentation to help.

Thanks!