Original element:
<div class="user-menu" dropdown-toggle>
After using cheerio on file:
<div class="user-menu" dropdown-toggle="">
For some reason cheerio is appending all empty attributes with =""
XHTML standard defines attr=attr for empty attributes.
Anyway to turn this off?
IMHO this should become the default behavior in non-XML mode. PRs for the dom-serializer module very appreciated.
@fb55, I sent a PR to fix this issue.
Please review and merge
Well I have the opposite problem :)
I'm working with xhtml and default="" is converted into default.
Problem come from that line :
if (!value && booleanAttributes[key]){
default is part of the booleanAttributes array.
So I guess we should check about xmlMode sooner.
Do you want a pull request ?
since dom-serializer ist not published to npm and cheerio is not updated to that new version yet, this issue is not fixed
Please reopen this issue, it's still broken!
Any chance of a new release of dom-serializer to fix this issue?
Maybe interested in https://github.com/cheeriojs/dom-serializer/pull/72
Most helpful comment
Please reopen this issue, it's still broken!