I'm on Node v21.5.0 and version 6.1.12 of the library. I have a pretty simple test case that I believe should work, judging from the issue about adding comment support to querySelector (https://github.com/taoqf/node-html-parser/issues/221).
index.js
import { parse } from 'node-html-parser'
import * as fs from 'fs';
const html = fs.readFileSync('./test.html').toString();
const parsed = parse(html, { comment: true });
const comments = parsed.querySelectorAll('!--');
console.log(comments);
test.html
<html>
<body>
<h1>TEST</h1>
<!-- Some comment here. -->
</body>
</html>
However, running this code prints []. I get the same result when the HTML is included inline as a raw string, so I don't think the file handling is at fault.
I'm on Node v21.5.0 and version 6.1.12 of the library. I have a pretty simple test case that I believe should work, judging from the issue about adding comment support to
querySelector
(https://github.com/taoqf/node-html-parser/issues/221).index.js
test.html
However, running this code prints
[]
. I get the same result when the HTML is included inline as a raw string, so I don't think the file handling is at fault.