code: static function minify_html(&$root, $strip_comments = true, $recursive = true) {
  		if ($strip_comments) {
  			foreach($root->select(':comment', false, $recursive, true) as $c) {
  				$prev = $c->getSibling(-1);
  				$next = $c->getSibling(1);
  				$c->delete();
  				if ($prev && $next && ($prev->isText()) && ($next->isText())) {
  					$prev->text .= $next->text;
  					$next->delete();
  				}
  			}
  		}
  		foreach($root->select('(!pre + !xmp + !style + !script + !"?php" + !"~text~" + !"~comment~"):not-empty > "~text~"', false, $recursive, true) as $c) {
  			$c->text = preg_replace('`\s+`', ' ', $c->text);
  		}
  	}
docs: Minifies HTML / removes unneeded whitespace
  @param DomNode $root
  @param bool $strip_comments
  @param bool $recursive