Fix handling spaces after <br> on html2text conversion

pull/280/head
Aleksander Machniak 9 years ago
parent 61c35b4a2b
commit 72863836e5

@ -142,7 +142,7 @@ class rcube_html2text
'/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with
'/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with
'/<p[^>]*>/i', // <P>
'/<br[^>]*>/i', // <br>
'/<br[^>]*>\s*/i', // <br>
'/<i[^>]*>(.*?)<\/i>/i', // <i>
'/<em[^>]*>(.*?)<\/em>/i', // <em>
'/(<ul[^>]*>|<\/ul>)/i', // <ul> and </ul>

@ -46,6 +46,11 @@ class rc_html2text extends PHPUnit_Framework_TestCase
'in' => chr(0x002).chr(0x003),
'out' => chr(0x002).chr(0x003),
),
7 => array(
'title' => 'Remove spaces after <br>',
'in' => 'test<br> test',
'out' => "test\ntest",
),
);
}

Loading…
Cancel
Save