We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It appears that removing an attribute causes boolean attributes to be rendered incorrectly:
const {parse} = require("node-html-parser") const inputEl = parse('<input>').firstChild inputEl.setAttribute('checked', '') inputEl.setAttribute('a', '') console.log(inputEl.toString()) // => <input checked a> CORRECT inputEl.removeAttribute('a') console.log(inputEl.toString()) // => <input checked=""> INCORRECT
If it helps narrow it down, the bug does not happen if the boolean attribute was not added using setAttribute:
const {parse} = require("node-html-parser") const inputEl = parse('<input checked>').firstChild inputEl.setAttribute('a', '') console.log(inputEl.toString()) // => <input checked a> CORRECT inputEl.removeAttribute('a') console.log(inputEl.toString()) // => <input checked> CORRECT
The text was updated successfully, but these errors were encountered:
5a6a614
No branches or pull requests
It appears that removing an attribute causes boolean attributes to be rendered incorrectly:
If it helps narrow it down, the bug does not happen if the boolean attribute was not added using setAttribute:
The text was updated successfully, but these errors were encountered: