Index: includes/mail.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/mail.inc,v
retrieving revision 1.7
diff -u -r1.7 mail.inc
--- includes/mail.inc	4 Sep 2007 21:10:45 -0000	1.7
+++ includes/mail.inc	4 Feb 2008 05:46:33 -0000
@@ -246,7 +246,7 @@
  *
  * This function provides suitable alternatives for the following tags:
  * <a> <em> <i> <strong> <b> <br> <p> <blockquote> <ul> <ol> <li> <dl> <dt>
- * <dd> <h1> <h2> <h3> <h4> <h5> <h6> <hr>
+ * <dd> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <code> <cite> 
  *
  * @param $string
  *   The string to be transformed.
@@ -260,9 +260,12 @@
   // Cache list of supported tags.
   static $supported_tags;
   if (empty($supported_tags)) {
-    $supported_tags = array('a', 'em', 'i', 'strong', 'b', 'br', 'p', 'blockquote', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr');
+    $supported_tags = array('a', 'em', 'i', 'strong', 'b', 'br', 'p', 'blockquote', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'code', 'cite');
   }
-
+  
+  // Preformatted tags (all spaces and newlines intact)
+  $preformatted_tags = array('code');
+   
   // Make sure only supported tags are kept.
   $allowed_tags = isset($allowed_tags) ? array_intersect($supported_tags, $allowed_tags) : $supported_tags;
 
@@ -272,7 +275,8 @@
   // Apply inline styles.
   $string = preg_replace('!</?(em|i)>!i', '/', $string);
   $string = preg_replace('!</?(strong|b)>!i', '*', $string);
-
+  $string = preg_replace('!</?(cite)>!i', '#', $string);
+  
   // Replace inline <a> tags with the text of link and a footnote.
   // 'See <a href="http://drupal.org">the Drupal site</a>' becomes
   // 'See the Drupal site [1]' with the URL included as a footnote.
@@ -383,12 +387,22 @@
         case '/dl':
           $chunk = ''; // Ensure blank new-line.
           break;
+          
+        // Code block 
+        case 'code':
+          $indent[] = '    ';
+          break;
+        case '/code':
+          array_pop($indent);
+          break;        	
       }
     }
     // Process blocks of text.
     else {
-      // Convert inline HTML text to plain text.
-      $value = trim(preg_replace('/\s+/', ' ', decode_entities($value)));
+      // Convert inline HTML text to plain text for non-preformatted tags.
+      if (!in_array($tagname, $preformatted_tags)) {
+        $value = trim(preg_replace('/\s+/', ' ', decode_entities($value)));
+      }
       if (strlen($value)) {
         $chunk = $value;
       }

