<img>: alt="" turns into alt after recent dependencies update - is this an intended change?
Author: tkafkaCreated Jan 8, 2020Updated Jul 5, 2025
Describe the bug
I did yarn upgrade of mjml dependencies, and suddenly all <img alt="" src="..." /> turned into <img alt src="..." /> in the output. Is this an intended change? Will this shorthand alt attribute be valid for all email clients?
I run mjml with --config.keepComments=0 --config.validationLevel=strict --config.beautify=false arguments.
To Reproduce Steps to reproduce the behavior:
- Create a file with this MJML code:
<mjml><mj-body><mj-text><img alt="" src="..." /></mj-text></mj-body></mjml> - Render it to HTML by doing 'mjml --config.keepComments=0 --config.validationLevel=strict --config.beautify=false`
MJML environment (please complete the following information):
- OS: MacOS
- MJML Version: 4.5.1
- MJML tool used: mjml cli
Source: mjmlio/mjml