Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed some to/from html issues

  • Loading branch information...
commit 4e5284b7b8778c815aa16ab6e029ad04da4d677e 1 parent 4c13c98
@tmpvar authored
View
7 lib/jsdom/browser/domtohtml.js
@@ -152,7 +152,10 @@ var generateHtmlRecursive = function(element) {
break;
case element.COMMENT_NODE:
ret += '<!-- ' + element.nodeValue + ' -->';
- break;
+ break;
+ case element.DOCUMENT_NODE:
+ ret += generateHtmlRecursive(element.documentElement);
+ break;
}
}
//require('sys').puts(require('sys').inspect(ret));
@@ -176,4 +179,4 @@ exports.domToHtml = function(dom){
return formatHTML(ret);
-}
+}
View
3  lib/jsdom/browser/htmltodom.js
@@ -96,7 +96,8 @@ var HtmlToDom = function(parser){
// utility function for forgiving parser
var setChild = function(node) {
- var newNode, currentDocument = this.ownerDocument || this;
+ var newNode, currentDocument = this._ownerDocument || this;
+
if (node.type == 'tag' || node.type == 'script' || node.type == 'style') {
newNode = currentDocument.createElement(node.name);
}

0 comments on commit 4e5284b

Please sign in to comment.
Something went wrong with that request. Please try again.