Fix attribute handling in JsHtmlParser to assign empty string for attributes without values

This commit is contained in:
Moustapha Kodjo Amadou 2025-11-07 19:17:57 +01:00
parent e288cb00d3
commit 430e062a06

View file

@ -160,9 +160,9 @@ class Parser {
} else {
// attribute without value (e.g. `disabled`)
if (this.options.onattribute) {
this.options.onattribute(attrName, null);
this.options.onattribute(attrName, "");
}
attrs[attrName] = null;
attrs[attrName] = "";
attrName = '';
}
}