diff --git modules/filter/filter.module modules/filter/filter.module
index 24c64bd..05f8757 100644
--- modules/filter/filter.module
+++ modules/filter/filter.module
@@ -1594,7 +1594,7 @@ function _filter_autop($text) {
   // We don't apply any processing to the contents of these tags to avoid messing
   // up code. We look for matched pairs and allow basic nesting. For example:
   // "processed <pre> ignored <script> ignored </script> ignored </pre> processed"
-  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|iframe|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
   // Note: PHP ensures the array consists of alternating delimiters and literals
   // and begins and ends with a literal (inserting NULL as required).
   $ignore = FALSE;
@@ -1603,7 +1603,7 @@ function _filter_autop($text) {
   foreach ($chunks as $i => $chunk) {
     if ($i % 2) {
       // Opening or closing tag?
-      $open = ($chunk[1] != '/' || $chunk[1] != '!');
+      $open = ($chunk[1] != '/' && $chunk[1] != '!');
       $comment = (substr($chunk, 0, 4) == '<!--');
       list($tag) = preg_split('/[ >]/', substr($chunk, 2 - $open), 2);
       if (!$ignore) {
diff --git modules/filter/filter.test modules/filter/filter.test
index e878477..92aeed7 100644
--- modules/filter/filter.test
+++ modules/filter/filter.test
@@ -800,6 +800,17 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
       "aaa\nbbb\n\nccc" => array(
         "<p>aaa<br />\nbbb</p>\n<p>ccc</p>" => TRUE,
       ),
+      // Comments remain unchanged and subsequent lines/paragraphs are
+      // transformed normally.
+      "aaa<!--comment-->\n\nbbb\n\nccc\n\nddd<!--comment\nwith linebreak-->\n\neee\n\nfff" => array(
+        "<p>aaa</p>\n<!--comment--><p>\nbbb</p>\n<p>ccc</p>\n<p>ddd</p>" => TRUE,
+        "<!--comment\nwith linebreak--><p>\neee</p>\n<p>fff</p>" => TRUE,
+      ),
+      // Preformatted tags remain unchanged and subsequent lines/paragraphs are
+      // transformed normally.
+      "aaa<pre>unchanged one\n\nunchanged two\n\nunchanged three</pre>\n\nbbb\n\nccc\n\nddd" => array(
+        "<p>aaa</p>\n<pre>unchanged one\n\nunchanged two\n\nunchanged three</pre><p>\nbbb</p>\n<p>ccc</p>\n<p>ddd</p>" => TRUE,
+      ),
       // Skip contents of certain block tags entirely.
       "<script>aaa\nbbb\n\nccc</script>
 <style>aaa\nbbb\n\nccc</style>
@@ -1459,7 +1470,7 @@ www.example.com with a newline in comments -->
         if (!$success) {
           $this->verbose('Source:<pre>' . check_plain(var_export($source, TRUE)) . '</pre>'
             . '<hr />' . 'Result:<pre>' . check_plain(var_export($result, TRUE)) . '</pre>'
-            . '<hr />' . ($is_expected ? 'Found:' : 'Not found:')
+            . '<hr />' . ($is_expected ? 'Expected:' : 'Not expected:')
             . '<pre>' . check_plain(var_export($value, TRUE)) . '</pre>'
           );
         }
