jonkemp / gulp-inline-css

Inline linked css in an html file. Useful for emails.
MIT License
272 stars 29 forks source link

applyTableAttributes altering html width and height attributes #47

Open Zaggamok opened 7 years ago

Zaggamok commented 7 years ago

Hi,

Although the description of options.applyTableAttributes reads: "Whether to apply the border, cellpadding and cellspacing attributes to table elements.",

It seems to have an effect on the width and height html values of tables, in that it adds 'px' to the numbers contained. example:

        <table width="49" height="49">
          <tbody>
            <tr>
              <td></td>
            </tr>
          </tbody>
        </table>

outputs:

        <table width="49px" height="49px" border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td></td>
            </tr>
          </tbody>
        </table>

This appears to mess with (my) table rendering D:

If it helps, my gulp task is as follows:

gulp.task('inline', function(){
    var stylesheet = fs.readFileSync('app/css/styles.css', 'utf8');
    return gulp.src('app/html/*.html')
        .pipe(inlineCss({
            applyStyleTags: false,
            removeStyleTags: false,
            applyTableAttributes: true,
            applyWidthAttributes:false,
            preserveMediaQueries: true,
            extraCss: stylesheet
        }))
        .pipe(gulp.dest('dist'));
});