diff --git a/include/class.format.php b/include/class.format.php
index fd51d95867d76918bb85e5a34d1eb524ee2066ff..4ed82d907684561a2cfc647678dde77e558e0a0b 100644
--- a/include/class.format.php
+++ b/include/class.format.php
@@ -168,6 +168,7 @@ class Format {
             'safe' => 1, //Exclude applet, embed, iframe, object and script tags.
             'balance' => 1, //balance and close unclosed tags.
             'comment' => 1, //Remove html comments (OUTLOOK LOVE THEM)
+            'tidy' => -1,
             'deny_attribute' => 'id',
             'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; src: cid, http, https, data',
             'hook_tag' => function ($el, $attributes=0) {
@@ -196,9 +197,6 @@ class Format {
             }
         );
 
-        if (!preg_match('/style="[^"]*white-space:\s*pre/i', $html) !== false)
-            $config['tidy'] = -1; // Clean extra whitspace
-
         return Format::html($html, $config);
     }
 
diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php
index f71c002517911d3fc3769086130eba35f8f622eb..0f1f7cef5a5737c1a23d2bdad285f0915c55fcf0 100644
--- a/include/class.mailfetch.php
+++ b/include/class.mailfetch.php
@@ -431,7 +431,7 @@ class MailFetcher {
             }
             elseif ($body=$this->getPart($mid, 'text/plain', $this->charset)) {
                 $body = trim($body)
-                    ? sprintf('<div style="white-space:pre-wrap">%s</div>',
+                    ? sprintf('<pre>%s</pre>',
                         Format::htmlchars($body))
                     : '--';
             }
@@ -444,7 +444,7 @@ class MailFetcher {
                 $body = Format::html2text(Format::safe_html($body), 100, false);
             }
             $body = trim($body)
-                ? sprintf('<div style="white-space:pre-wrap">%s</div>',
+                ? sprintf('<pre>%s</pre>',
                     $body)
                 : '--';
         }
diff --git a/include/class.mailparse.php b/include/class.mailparse.php
index 15247689ca10f3ea5c059c11efd26956002ae70f..8d84f3f5afeb4d8129490def2802b158aa3f0dd7 100644
--- a/include/class.mailparse.php
+++ b/include/class.mailparse.php
@@ -181,7 +181,7 @@ class Mail_Parse {
             }
             elseif ($body=$this->getPart($this->struct,'text/plain')) {
                 $body = trim($body)
-                    ? sprintf('<div style="white-space:pre-wrap">%s</div>',
+                    ? sprintf('<pre>%s</pre>',
                         Format::htmlchars($body))
                     : '--';
             }
@@ -194,7 +194,7 @@ class Mail_Parse {
                 $body = Format::html2text(Format::safe_html($body), 100, false);
             }
             $body = trim($body)
-                ? sprintf('<div style="white-space:pre-wrap">%s</div>',
+                ? sprintf('<pre>%s</pre>',
                     $body)
                 : '--';
         }