inline-css
Version:
Inline css into an html file.
20 lines (15 loc) • 472 B
JavaScript
var widthElements = [ 'table', 'td', 'img' ];
module.exports = function (el, $) {
var i,
pxWidth;
if (widthElements.indexOf(el.name) > -1) {
for (i in el.styleProps) {
if (el.styleProps[i].prop === 'width' && el.styleProps[i].value.match(/px/)) {
pxWidth = el.styleProps[i].value.replace('px', '');
$(el).attr('width', pxWidth);
return;
}
}
}
};
;