summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/lib/Roundcube/rcube_html2text.php2
-rw-r--r--tests/Framework/Html2text.php5
2 files changed, 6 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php
index 284e50dca..00a59a7f3 100644
--- a/program/lib/Roundcube/rcube_html2text.php
+++ b/program/lib/Roundcube/rcube_html2text.php
@@ -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>
diff --git a/tests/Framework/Html2text.php b/tests/Framework/Html2text.php
index 76b1f16cd..dee767057 100644
--- a/tests/Framework/Html2text.php
+++ b/tests/Framework/Html2text.php
@@ -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",
+ ),
);
}