Skip to content

Commit

Permalink
[FIX] mjmlio#2578 remove height attribute if empty (mjmlio#2598)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxime Brazeilles <[email protected]>
  • Loading branch information
iRyusa and Maxime Brazeilles authored Dec 16, 2022
1 parent 1146422 commit 85bc58e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mjml-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ export default class MjImage extends BodyComponent {
<img
${this.htmlAttributes({
alt: this.getAttribute('alt'),
height: height && (height === 'auto' ? height : parseInt(height, 10)),
src: this.getAttribute('src'),
srcset: this.getAttribute('srcset'),
sizes: this.getAttribute('sizes'),
style: 'img',
title: this.getAttribute('title'),
width: this.getContentWidth(),
usemap: this.getAttribute('usemap'),
...(height
? { height: height === 'auto' ? height : parseInt(height, 10) }
: {}),
})}
/>
`
Expand Down

0 comments on commit 85bc58e

Please sign in to comment.