We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b831df3 commit 31ea955Copy full SHA for 31ea955
src/PHPHtmlParser/Dom.php
@@ -373,7 +373,9 @@ protected function clean($str)
373
$str = mb_eregi_replace("<!doctype(.*?)>", '', $str);
374
375
// strip out comments
376
- $str = mb_eregi_replace("<!--(.*?)-->", '', $str);
+ if ($this->options->get('removeComments')) {
377
+ $str = mb_eregi_replace("<!--(.*?)-->", '', $str);
378
+ }
379
380
// strip out cdata
381
$str = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str);
0 commit comments