This addresses the issue where some mail clients, like Outlook, require there to be a width attribute defined on images in order to set a width other than the natural width. The change is setup so that an option has been added applyWidthAttributes and when set to true (the default is false to maintain backward compatibility) the width attribute on elements of types in the new juice.widthElements array (default is [TABLE, TD, IMG]) are set to any pixel width CSS values applied to those elements.
This change removes the need to set widths in CSS and again in HTML for some elements, so code is DRYer and behaves closer to browser CSS.
I don't believe this change to be breaking, a new test has been added and all preexisting tests pass without changes.
This addresses the issue where some mail clients, like Outlook, require there to be a
width
attribute defined on images in order to set a width other than the natural width. The change is setup so that an option has been addedapplyWidthAttributes
and when set totrue
(the default isfalse
to maintain backward compatibility) thewidth
attribute on elements of types in the newjuice.widthElements
array (default is [TABLE, TD, IMG]) are set to any pixel width CSS values applied to those elements.This change removes the need to set widths in CSS and again in HTML for some elements, so code is DRYer and behaves closer to browser CSS.
I don't believe this change to be breaking, a new test has been added and all preexisting tests pass without changes.