summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-03 07:16:52 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-03 07:16:52 +0000
commit3e51b43f7f6d984ffc63855d007e74908aee414d (patch)
treec353c2f647d1328d3e0e51ebd876c62a4508e8c4
parent0a775eb6b1d4a7972a8414c36033b80bd2e0bac6 (diff)
- Remove leading empty lines (can be produced by eg. P tag on the beginning)
git-svn-id: https://svn.roundcube.net/trunk@4722 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/lib/html2text.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/roundcubemail/program/lib/html2text.php b/roundcubemail/program/lib/html2text.php
index 48df4592c..1ab16055b 100644
--- a/roundcubemail/program/lib/html2text.php
+++ b/roundcubemail/program/lib/html2text.php
@@ -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.