alecpl
2011-05-03 4d7fbd508aa50df367f9f055d95f22b697dab5f9
- Remove leading empty lines (can be produced by eg. P tag on the beginning)


1 files modified
3 ■■■■■ changed files
program/lib/html2text.php 3 ●●●●● patch | view | raw | blame | history
program/lib/html2text.php
@@ -515,6 +515,9 @@
        $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.