Clipper/joplin-webclipper/content_scripts/Readability.js
function(node) {
    var classesToPreserve = this._classesToPreserve;
    var className = (node.getAttribute("class") || "")
      .split(/\s+/)
      .filter(function(cls) {
        return classesToPreserve.indexOf(cls) != -1;
      })
      .join(" ");

    if (className) {
      node.setAttribute("class", className);
    } else {
      node.removeAttribute("class");
    }

    for (node = node.firstElementChild; node; node = node.nextElementSibling) {
      this._cleanClasses(node);
    }
  }
function(node) {
    var classesToPreserve = this._classesToPreserve;
    var className = (node.getAttribute("class") || "")
      .split(/\s+/)
      .filter(function(cls) {
        return classesToPreserve.indexOf(cls) != -1;
      })
      .join(" ");

    if (className) {
      node.setAttribute("class", className);
    } else {
      node.removeAttribute("class");
    }

    for (node = node.firstElementChild; node; node = node.nextElementSibling) {
      this._cleanClasses(node);
    }
  }
function ( node ) { var classesToPreserve = this . _classesToPreserve ; var className = ( node . getAttribute ( "class" ) || "" ) . split ( / \s+ / ) . filter ( function ( cls ) { return classesToPreserve . indexOf ( cls ) != - 1 ; } ) . join ( " " ) ; if ( className ) { node . setAttribute ( "class" , className ) ; } else { node . removeAttribute ( "class" ) ; } for ( node = node . firstElementChild ; node ; node = node . nextElementSibling ) { this . _cleanClasses ( node ) ; } }
Removes the class="" attribute from every element in the given
subtree, except those that match CLASSES_TO_PRESERVE and
the classesToPreserve array from the options object.

@param Element
@return void
Removes the class = attribute from every element in the given subtree except those that match CLASSES_TO_PRESERVE and the classesToPreserve array from the options object .