gulp-inline-css icon indicating copy to clipboard operation
gulp-inline-css copied to clipboard

applyTableAttributes altering html width and height attributes

Open Zaggamok opened this issue 8 years ago • 0 comments
trafficstars

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'));
});

Zaggamok avatar Jul 07 '17 07:07 Zaggamok