Closed xeoncross closed 13 years ago
Hi David, thanks for the feedback! I thought about doing that but take the following XHTML snippet for instance:
<input type="checkbox" disabled="disabled" checked="checked" />
It's the exact HTML (4 and 5) equivalent of:
<input type="checkbox" disabled checked>
In HTML, attributes with no values are considered valid, removing them could cause some problems (depending on the whitelist).
Right you are sir!
The main thing I was trying to fix is empty class=""
or id=""
attributes taking up extra space. I guess it really don't matter though.
I would like that too, but the DOMAttr
class has no way of distinguishing between empty and absent attributes.
Without compiling a list of attributes that can have no value, I don't see any other way of accomplish that goal. Maybe Tidy could do something here, but I've had bad experiences with it in the past, specially with HTML 5 and HTML partials.
I was just checking out the nice updates you've made to Purify when I noticed that empty attributes are still allowed on DOM elements. You might want to remove them since they just waste space.
Add this on line 1794.