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

abbr tag not parsed correctly #254

Closed julienc91 closed 11 months ago

julienc91 commented 11 months ago

Hi,

A bug seems to be affecting the parsing of the abbr tag:

> const { parse } = require("node-html-parser")
> parse("<a>foo</a>").querySelector("a").innerText
'foo'
> parse("<abbr>foo</abbr>").querySelector("abbr").innerText
'\n'

I was able to reproduce this bug on Node 16.15 with versions 6.1.9 and 6.1.10 of the package. In 6.1.8, everything works as expected:

> parse("<abbr>foo</abbr>").querySelector("abbr").innerText
'foo'

I couldn't find other tags with a similar behaviour.