posthtml / htmlnano

Modular HTML minifier, built on top of the PostHTML

Home Page:https://htmlnano.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: `sortAttributesWithLists` breaks `<img sizes="(min-width: 300px) 200px, 100px">`

mischnic opened this issue · comments

const htmlnano = require("htmlnano");

htmlnano
    .process(
        `
<img sizes="(min-width: 300px) 200px, 100px">`,
        {
            minifyCss: false,
            sortAttributesWithLists: false,
        }
    )
    .then(function (result) {
        console.log(result.html);
    })
    .catch(function (err) {
        console.error(err);
    });

Wrong Output with sortAttributesWithLists enabled: <img sizes="(min-width: 100px 200px, 300px)">
Output with sortAttributesWithLists disabled: <img sizes="(min-width: 300px) 200px, 100px">