Swaagie / minimize

Minimize HTML
MIT License
162 stars 18 forks source link

Empty attributes are assigned blank values #70

Closed Wasmoo closed 8 years ago

Wasmoo commented 8 years ago

This is a repeat of the previously closed issue https://github.com/Swaagie/minimize/issues/15

In version 1.7.4, the following

    <div test></div>

turns into

   <div test=""></div>

I believe it has to do with the "spare" config. Here is my configuration

    {
        empty: true,        // KEEP empty attributes
        cdata: false,       // DROP CDATA from scripts
        comments: false,    // DROP comments
        ssi: false,         // DROP Server Side Includes
        conditionals: true, // KEEP conditional internet explorer comments
        spare: true,        // KEEP redundant attributes
        quotes: true,       // KEEP arbitrary quotes
        loose: true,        // KEEP one whitespace
    }
Swaagie commented 8 years ago

To verify, your using the options.spare = true setting?

Swaagie commented 8 years ago

If you want to have the value removed use empty: true, to problem is empty and spare are mutually exclusive.

Swaagie commented 8 years ago

Fixed some code style issues when checking the logic and this commit https://github.com/Swaagie/minimize/commit/128c6af2e4efd282681d1aabf9bde0927606dade shows expected results with both tests.

Swaagie commented 8 years ago

Closing this due to lack of response, feel free to reopen if you still have issues. Note the comment above though