Closed mraxus closed 2 years ago
Tested with latest 5.2.0; nodeJs v14.19.0.
When running the following example I get 0 nodes found, when in fact there is one:
const { parse: HtmlParser } = require('node-html-parser'); var ls = `<html><head><script src="js/book.js" /><meta charset="UTF-8"/></head></html>` console.log(HtmlParser(ls).querySelectorAll('meta').length);
If I change the <script src="js/book.js" /> to <script src="js/book.js"></script> (or remove it), the code returns 1.
<script src="js/book.js" />
<script src="js/book.js"></script>
script is not treated as self-cloing tag for now. I searched for the support, find this
script
try v5.4.0
Tested with latest 5.2.0; nodeJs v14.19.0.
When running the following example I get 0 nodes found, when in fact there is one:
If I change the
<script src="js/book.js" />
to<script src="js/book.js"></script>
(or remove it), the code returns 1.