Closed olgaplaga closed 1 year ago
Adding heigt="auto" by default breaks image display inside email drafts in the Apple Mail application.
I'm not sure what's the usecase here as sending HTML email via clients will alter the HTML and most likely break the email.
However you can add height=""
to mj-image and reset it with mj-attributes if you want so. I'm not sure if the blank height
attribute will do something bad tho.
Thanks for the quick answer @iRyusa .
I'm not sure what's the use case here as sending HTML emails via clients will alter the HTML and most likely break the email.
I know that sad phenomenon, however, I believe that the more such use cases can be captured and corrected from a code perspective, the scope for uncontrolled HTML changes between email clients can decrease. This particular case I reported is an important part of a project I'm working on, and I believe many developers will find the option to have more control over it helpful.
I have tested the blank height
attribute and it still causes the same problem as with height="auto"
.
As fair as I remember the height auto isn't mandatory but it helps some version of Outlook to keep the aspect ratio in some cases.
I'll check if I can do a patch to completely remove height
if set as an empty string 👍
I am wondering if that patch allow the Outlook pixel line bug to appear its' ugly head. I post it over at - https://github.com/mjmlio/mjml/issues/2630
Don't think so.
But this has been release in 4.14.x
By default, there are defined
defaultAttributes
formj-image
tag that include:Adding
heigt="auto"
by default breaks image display inside email drafts in the Apple Mail application. Images are not displayed at all or are not correctly scaled.Possible solutions for this issue:
height="auto"
by default to images (if it is not really necessary)height="auto"
by MJML (before compilation) without the need to define image height to a particular size.style=
without adding it as a separateheight
attribute.