I’m using jQuery with jsdom (0.2.10). For some reason node.exe (0.6.5.1) never returns when dealing with HTML such as this one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head></HEAD>
<body></BODY>
</HTML>
The parsing code is:
var request = require('request'),
jsdom = require('jsdom');
request({ uri:'http://localhost/test.html' }, function (error, response, body) {
jsdom.env({
html: body,
scripts: ['http://code.jquery.com/jquery-1.7.1.min.js'],
done: function (err, window) {
var $ = window.jQuery;
console.log('node.exe should get terminated after this line but does not.');
}
});
});
Using same case for the tag names works as expected (i.e. node.exe returns). But since I have no control over HTML I’m parsing, I wonder if there is a way around this problem. Also, body.toLowerCase() helps in terminating node.exe, however it’s not a viable solution because I need to preserve original case of the text nodes.
Thank you.
There is a bug in
node-htmlparsermodule. Parsingyields different results for each of the line.
Here‘s my pull request for those interested.