html-minifier-terser
html-minifier-terser copied to clipboard
[Bug]: Remove redundant attributes should support <img> loading attribute
What happened?
The default value for the lazy loading attribute of the <img> tag is "eager". See the spec.
The following htnl:
<img src="logo.jpg" alt="Our logo" loading="eager">
should be minified like this when removeRedundantAttributes is set to true:
<img src="logo.jpg" alt="Our logo">
I haven't checked, but I suspect there are a lot more default attributes that could be supported but aren't currently. Basically all enumerated attributes according to the spec should have their default value added to the minifier.
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
No response
Relevant log output
No response
Willing to submit a PR?
Yes
Thanks for reporting this. Feel free to provide a PR.