diff --git a/lib/jsdom/browser/htmltodom.js b/lib/jsdom/browser/htmltodom.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom/browser/htmltodom.js
+++ b/lib/jsdom/browser/htmltodom.js
@@ -64,10 +64,6 @@ var HtmlToDom = function(parser){
           html +='';
       }
       
-      // jos3000: not sure why this is here to clean up whitespace...
-      html = html.replace(/\n/gm, '');
-      html = html.replace(/  /gm, '');
-
       var parsed = parser.ParseHtml(html);
 
       for (var i = 0; i < parsed.length; i++) {
diff --git a/test/browser/index.js b/test/browser/index.js
index <HASH>..<HASH> 100644
--- a/test/browser/index.js
+++ b/test/browser/index.js
@@ -153,5 +153,19 @@ exports.tests = {
 
     assertSame("original and processed", head.innerHTML, styleHtml);
 
+  },
+  parse_doublespacetags : function() {
+    var doc = new browser.Document();
+    
+    var html = '<html><body  class="testing" /></html>';
+    
+    exception = false;
+    try {
+      doc.innerHTML = html;
+    }
+    catch(ex) {
+      exception = true;
+    }
+    assertFalse("setValue_throws_INVALID_CHARACTER_ERR", exception);
   }
 };
Fixed the Document.innerHTML setter to parse HTML with double spaces correctly. Previously it flattened double spaces to no whitespace, breaking the parsing if an element name and its attributes were separate by double whitespace.