Skip to content

Commit

Permalink
Updated comments striping - added special option
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbiabram authored Sep 5, 2016
1 parent b831df3 commit 31ea955
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PHPHtmlParser/Dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ protected function clean($str)
$str = mb_eregi_replace("<!doctype(.*?)>", '', $str);

// strip out comments
$str = mb_eregi_replace("<!--(.*?)-->", '', $str);
if ($this->options->get('removeComments')) {
$str = mb_eregi_replace("<!--(.*?)-->", '', $str);
}

// strip out cdata
$str = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str);
Expand Down

0 comments on commit 31ea955

Please sign in to comment.