diff --git a/modules/filter/filter.install b/modules/filter/filter.install
index 71ba97b..ef52629 100644
--- a/modules/filter/filter.install
+++ b/modules/filter/filter.install
@@ -490,5 +490,12 @@ function filter_update_7010() {
 }
 
 /**
+ * Mark comments as allowed in the HTML filter.
+ */
+function filter_update_7011() {
+  variable_set('filter_html_comments', 1);
+}
+
+/**
  * @} End of "addtogroup updates-6.x-to-7.x".
  */
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index f4bab9e..5285702 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -1221,6 +1221,7 @@ function filter_filter_info() {
     'default settings' => array(
       'allowed_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>',
       'filter_html_help' => 1,
+      'filter_html_comments' => 1,
       'filter_html_nofollow' => 0,
     ),
     'tips callback' => '_filter_html_tips',
@@ -1269,6 +1270,11 @@ function _filter_html_settings($form, &$form_state, $filter, $format, $defaults)
     '#maxlength' => 1024,
     '#description' => t('A list of HTML tags that can be used. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.'),
   );
+  $settings['filter_html_comments'] = array(
+    '#title' => t('Allow HTML comments'),
+    '#type' => 'checkbox',
+    '#default_value' => $filter->settings['filter_html_comments'],
+  );
   $settings['filter_html_help'] = array(
     '#type' => 'checkbox',
     '#title' => t('Display basic HTML help in long filter tips'),
@@ -1300,6 +1306,11 @@ function _filter_html($text, $filter) {
     $text = filter_dom_serialize($html_dom);
   }
 
+  // Check for HTML comments, and add if allowed.
+  if ($filter->settings['filter_html_comments']) {
+    $filter->settings['allowed_html'] .= ' <!-->';
+  }
+
   return trim($text);
 }
 
