Skip to content

Commit 31ea955

Browse files
authored
Updated comments striping - added special option
1 parent b831df3 commit 31ea955

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PHPHtmlParser/Dom.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ protected function clean($str)
373373
$str = mb_eregi_replace("<!doctype(.*?)>", '', $str);
374374

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

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

0 commit comments

Comments
 (0)