lib/index.js
function _parse(content, options, callback) {

	if(typeof options == 'function') {

		callback     = options;
		options.test = false;

	}


	var on = outcome.error(callback),
	warnings,
	window;

	step(

		/**
		 * load it.
		 */

		function() {

			jsdom.env({
				html: content,
				scripts: [
			  		__dirname + "/jquery-1.5.js"
				],
				done: this
			});

		},


		/**
		 * set it.
		 */

		on.success(function(win) {


			window = win;
			_copyStyles(window);
			this();

		}),

		/**
		 * test it.
		 */

		on.success(function() {

			if(!options.test) {

				return this();

			}

			test(window, {}, this);

		}),

		/**
		 * clean it.
		 */

		on.success(function(warn) {

			warnings = warn;

			//strip stuff that cannot be processed
			window.$('script, link, style').remove();

            if (!options.comments) {
                //strip comments - sometimes gets rendered
                window.$('*').contents().each(function(node) {
                    if(this.nodeType == 8) {
                        window.$(this).remove();
                    }
                });
            }

			this();

		}),


		/**
		 * finish it.
		 */

		function() {

			callback(null, window.document.documentElement.innerHTML, warnings || []);

		}
	);


}
function _parse(content, options, callback) {

	if(typeof options == 'function') {

		callback     = options;
		options.test = false;

	}


	var on = outcome.error(callback),
	warnings,
	window;

	step(

		/**
		 * load it.
		 */

		function() {

			jsdom.env({
				html: content,
				scripts: [
			  		__dirname + "/jquery-1.5.js"
				],
				done: this
			});

		},


		/**
		 * set it.
		 */

		on.success(function(win) {


			window = win;
			_copyStyles(window);
			this();

		}),

		/**
		 * test it.
		 */

		on.success(function() {

			if(!options.test) {

				return this();

			}

			test(window, {}, this);

		}),

		/**
		 * clean it.
		 */

		on.success(function(warn) {

			warnings = warn;

			//strip stuff that cannot be processed
			window.$('script, link, style').remove();

            if (!options.comments) {
                //strip comments - sometimes gets rendered
                window.$('*').contents().each(function(node) {
                    if(this.nodeType == 8) {
                        window.$(this).remove();
                    }
                });
            }

			this();

		}),


		/**
		 * finish it.
		 */

		function() {

			callback(null, window.document.documentElement.innerHTML, warnings || []);

		}
	);


}
function _parse ( content , options , callback ) { if ( typeof options == 'function' ) { callback = options ; options . test = false ; } var on = outcome . error ( callback ) , warnings , window ; step ( /**
		 * load it.
		 */ function ( ) { jsdom . env ( { html : content , scripts : [ __dirname + "/jquery-1.5.js" ] , done : this } ) ; } , /**
		 * set it.
		 */ on . success ( function ( win ) { window = win ; _copyStyles ( window ) ; this ( ) ; } ) , /**
		 * test it.
		 */ on . success ( function ( ) { if ( ! options . test ) { return this ( ) ; } test ( window , { } , this ) ; } ) , /**
		 * clean it.
		 */ on . success ( function ( warn ) { warnings = warn ; //strip stuff that cannot be processed window . $ ( 'script, link, style' ) . remove ( ) ; if ( ! options . comments ) { //strip comments - sometimes gets rendered window . $ ( '*' ) . contents ( ) . each ( function ( node ) { if ( this . nodeType == 8 ) { window . $ ( this ) . remove ( ) ; } } ) ; } this ( ) ; } ) , /**
		 * finish it.
		 */ function ( ) { callback ( null , window . document . documentElement . innerHTML , warnings || [ ] ) ; } ) ; }
parses content into email-safe HTML
parses content into email - safe HTML