summaryrefslogtreecommitdiff
path: root/program/lib/html2text.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-05-04 18:53:11 +0000
committeralecpl <alec@alec.pl>2011-05-04 18:53:11 +0000
commitba9c7b40f0dfcadf1d5711246e7b332ff7a60787 (patch)
tree10d8bc0a125fe8bc29d33592a480e245c5627e21 /program/lib/html2text.php
parent4a7ed027e4d9b605060cecc9bd97bc3dd2c1889b (diff)
- Apply fixes from trunk (up to r4728)
Diffstat (limited to 'program/lib/html2text.php')
-rw-r--r--program/lib/html2text.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/program/lib/html2text.php b/program/lib/html2text.php
index 48df4592c..1ab16055b 100644
--- a/program/lib/html2text.php
+++ b/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.