[dev] Patch: imp/lib/MIME/Viewer/plain.php

Marc Jauvin marc at register4less.com
Thu May 29 00:38:39 PDT 2003


This patch fixes some problems with TAB expansion not aligning correctly.
(now uses <pre> </pre> tag around the text)

Please, commit!

--
Marc Jauvin
450-441-5458
http://register4less.com
-------------- next part --------------
Index: plain.php
===================================================================
RCS file: /repository/imp/lib/MIME/Viewer/plain.php,v
retrieving revision 1.21
diff -u -r1.21 plain.php
--- plain.php   16 May 2003 15:26:13 -0000      1.21
+++ plain.php   29 May 2003 07:35:01 -0000
@@ -84,14 +84,8 @@
         // Filter bad language.
         $text = IMP::filterText($text);
 
-        // Wordwrap.
-        $text = str_replace("\t", '        ', $text);
-        $text = str_replace('  ', ' &nbsp;', $text);
-        $text = str_replace("\n ", "\n&nbsp;", $text);
-        if ($text{0} == ' ') {
-            $text = '&nbsp;' . substr($text, 1);
-        }
-        $text = '<p class="fixed">' . $text . '</p>';
+        $text = str_replace("\n", "", $text);
+        $text = '<pre>' . $text . '</pre>';
 
         /* If the text is in a different character set, and we're not
            already in a new window, give the user a link to open it in
@@ -153,5 +147,4 @@
             return parent::getCharset();
         }
     }
-
 }


More information about the dev mailing list