]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/lib/html2text.php
Imported Upstream version 0.5.3+dfsg
[roundcube.git] / program / lib / html2text.php
index 48df4592c552cb6b7781d8048ce98be418a15489..1ab16055bebb5aeb88733e37bc082fa101b2d34a 100644 (file)
@@ -515,6 +515,9 @@ class html2text
         $text = preg_replace("/\n\s+\n/", "\n\n", $text);
         $text = preg_replace("/[\n]{3,}/", "\n\n", $text);
 
+        // remove leading empty lines (can be produced by eg. P tag on the beginning)
+        $text = preg_replace('/^\n+/', '', $text);
+
         // Wrap the text to a readable format
         // for PHP versions >= 4.0.2. Default width is 75
         // If width is 0 or less, don't wrap the text.