diff --git a/src/PHPHtmlParser/Dom.php b/src/PHPHtmlParser/Dom.php
index f3e17ff..06dcc78 100644
--- a/src/PHPHtmlParser/Dom.php
+++ b/src/PHPHtmlParser/Dom.php
@@ -373,7 +373,9 @@ protected function clean($str)
$str = mb_eregi_replace("", '', $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("", '', $str);