taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.11k stars 107 forks source link

Parser is modifying element attributes #145

Closed Amrrx closed 3 years ago

Amrrx commented 3 years ago

Hello,

Am trying to parse an html to edit some tags attributes then rewrite the file back again

the parser has ability to read and write the file correctly to its original state unless you make any change in attributes list.

Am trying to change this element attributes by inserting a new attribute key and value

<input matInput (keyup)="applyFilter($event)" placeholder="Ex. IMEI" #input>

the output is slightly different <input matInput keyup applyFilter event placeholder="Ex. IMEI" input demoAttr="demot_Test">

as you can notice the attributes had changed. I with if there is any support.

Thank you