taoqf / node-html-parser

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

Textarea renders erroneously #109

Closed poisonborz closed 3 years ago

poisonborz commented 3 years ago

Textarea renders erroneously - not that only it doesn't use the separate close tag as in input (as I think it should), but it also misses /> closing tag.

const np = require('node-html-parser')
console.log(np.parse('<textarea id="input_3"></textarea>').toString())

Output: <textarea id="input_3">

taoqf commented 3 years ago

Yes, textarea is being treated as selfclose tag.

poisonborz commented 3 years ago

Textarea is not selfclosing https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea (even if it would be, the result above is not selfclosing either)

taoqf commented 3 years ago

Yeah, you are write. I will fix this.