I found a issues when my dom tree include a button。
version: 4.1.0
const htmlparser2 = require("htmlparser2");
const parser = new htmlparser2.Parser({
onopentag(name, attributes) {
console.log('opentag', name)
},
onclosetag(tagname) {
console.log('closeTag', tagname)
},
});
parser.write(
"<button><input /></button>"
);
parser.end();
Output:
"opentag button"
"closeTag button"
"opentag input"
"closeTag input"
Expect:
"opentag button"
"opentag input"
"closeTag input"
"closeTag button"
This issues only happen with a button tag contain other tag.
Owner Name | fb55 |
Repo Name | htmlparser2 |
Full Name | fb55/htmlparser2 |
Language | TypeScript |
Created Date | 2011-08-27 |
Updated Date | 2023-03-19 |
Star Count | 3793 |
Watcher Count | 50 |
Fork Count | 370 |
Issue Count | 4 |
Issue Title | Created Date | Updated Date |
---|