kangax / html-minifier

Javascript-based HTML compressor/minifier (with Node.js support)
http://kangax.github.io/html-minifier/
MIT License
4.92k stars 568 forks source link

Disable changing attributes #1139

Closed michael-mashush closed 8 months ago

michael-mashush commented 1 year ago

source/index.html <source srcset="./assets/images/banners/home/banner_100x.webp 1x, ./assets/images/banners/home/banner_200x.webp 2x" /> build/index.html <source srcset="./assets/images/banners/home/banner_100x.webp, ./assets/images/banners/home/banner_200x.webp 2x" /> why is "1x" removed from "srcset" attribute?

michael-mashush commented 1 year ago

UPD: if you use the src attribute on the source tag, everything will work correctly, but inside the picture tag, you must use the srcset attribute

michael-mashush commented 1 year ago

UPD 2.0: Turns out the x1 flag is optional