I am building an html2xhtml converter on top of parse5 (https://github.com/cburgmer/http2xhtml.js/blob/master/lib/converter.js).
It seems I need to handle boolean attributes (e.g. <input type="checkbox" checked>) myself.
parse5 will return such an attribute as {name: "checked", value: ""}. This does not allow me to distinguish from actual attributes with empty string values.
I could not find much more information on those kind of attributes, so I am posing this as a question: should the parser know about those attributes and return something accordingly?
I am building an html2xhtml converter on top of parse5 (https://github.com/cburgmer/http2xhtml.js/blob/master/lib/converter.js).
It seems I need to handle boolean attributes (e.g.
<input type="checkbox" checked>) myself.parse5 will return such an attribute as
{name: "checked", value: ""}. This does not allow me to distinguish from actual attributes with empty string values.I could not find much more information on those kind of attributes, so I am posing this as a question: should the parser know about those attributes and return something accordingly?