From 4d7fbd508aa50df367f9f055d95f22b697dab5f9 Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 3 May 2011 07:16:52 +0000 Subject: - Remove leading empty lines (can be produced by eg. P tag on the beginning) --- program/lib/html2text.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'program') 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. -- cgit v1.2.3