Closed johnnyoshika closed 2 years ago
Thanks for the report + the repro!
Looks like it's getting treated as preformatted (pre
tag). Seems there's some regex which matches against partial, instead of full, tag name.
Will have a look at correcting it this weekend. I believe as a temporary workaround, passing the following should work:
{
blockTextElements: {
script: true,
noscript: true,
style: true
}
}
That option did the trick: https://codesandbox.io/s/node-html-parser-premises-k5z81?file=/src/index.js
Please let me know when you cut a new release with this fix, as I'll update my projects with it. Thanks for the quick response!
Corrected in v5
It seems the
premises
tag (or something similar likex-premises
, etc) has some strange and unexpected behavior withquerySelector()
andquerySelectorAll()
.Example:
The only difference between sample1 and sample2 is that sample1 wraps the HTML in a
premises
tag, whereas sample 2 usesfoo
. Yet the query for the color tag yields different results.Here's a Codesandbox example: https://codesandbox.io/s/node-html-parser-premises-k5z81?file=/src/index.js:43-210