Empty attributes are assigned blank values
Wasmoo opened this issue · 4 comments
Wasmoo commented
This is a repeat of the previously closed issue #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
To verify, your using the options.spare = true
setting?
Swaagie commented
If you want to have the value removed use empty: true
, to problem is empty
and spare
are mutually exclusive.
Swaagie commented
Fixed some code style issues when checking the logic and this commit 128c6af shows expected results with both tests.
Swaagie commented
Closing this due to lack of response, feel free to reopen if you still have issues. Note the comment above though