Clipper/joplin-webclipper/content_scripts/JSDOMParser.js
function (html, url) {
      this.html = html;
      var doc = this.doc = new Document(url);
      this.readChildren(doc);

      // If this is an HTML document, remove root-level children except for the
      // <html> node
      if (doc.documentElement) {
        for (var i = doc.childNodes.length; --i >= 0;) {
          var child = doc.childNodes[i];
          if (child !== doc.documentElement) {
            doc.removeChild(child);
          }
        }
      }

      return doc;
    }
function (html, url) {
      this.html = html;
      var doc = this.doc = new Document(url);
      this.readChildren(doc);

      // If this is an HTML document, remove root-level children except for the
      // <html> node
      if (doc.documentElement) {
        for (var i = doc.childNodes.length; --i >= 0;) {
          var child = doc.childNodes[i];
          if (child !== doc.documentElement) {
            doc.removeChild(child);
          }
        }
      }

      return doc;
    }
function ( html , url ) { this . html = html ; var doc = this . doc = new Document ( url ) ; this . readChildren ( doc ) ; // If this is an HTML document, remove root-level children except for the // <html> node if ( doc . documentElement ) { for ( var i = doc . childNodes . length ; -- i >= 0 ; ) { var child = doc . childNodes [ i ] ; if ( child !== doc . documentElement ) { doc . removeChild ( child ) ; } } } return doc ; }
Parses an HTML string and returns a JS implementation of the Document.
Parses an HTML string and returns a JS implementation of the Document .