When using the JSDOM module on raw html, it removes any trace of inline events. I’m not sure why it would do this so arbitrarily.
Did anyone find a way to get around this or is it something i’m doing wrong?
Example:
var jsdom = require('jsdom');
jsdom.defaultDocumentFeatures = {
FetchExternalResources : false,
ProcessExternalResources : false,
MutationEvents : false,
QuerySelector : false
};
var body="<a onclick='foo();'>FOO</a>";
var window = jsdom.jsdom(body).createWindow();
console.log(window.document.innerHTML);
This code would output
<a>FOO</a>
this has been fixed as of jsdom 0.2.8