Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Forked from jos3000/gist:436742
Created June 13, 2010 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmpvar/436815 to your computer and use it in GitHub Desktop.
Save tmpvar/436815 to your computer and use it in GitHub Desktop.
var sys = require("sys"),
dom = require("jsdom/lib/level1/core").dom.level1.core,
fs = require("fs"),
sax = require("jsdom/example/sizzle/sax"),
document = require("jsdom/lib/browser").windowAugmentation(dom, {parser: sax.parser()}).document,
div = document.createElement('div');
document.body.appendChild(div);
div.innerHTML = "<span><img src='test' />foo<br /> bar<br /> </span><p><script>alert('test');\n\nconsole.log();</script>ting</p>";
sys.puts(document.outerHTML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment