File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,6 +367,9 @@ static function toPlainText($html) {
367367 // elements that convert to single newline
368368 $ plain = (string ) preg_replace (array ('/<br[^>]*>/i ' , '/(<tr[^>]*>|<\/tr>)/i ' ), "\n" , $ plain ); // <br> <tr>
369369
370+ // div elements
371+ $ plain = (string ) preg_replace ('/<div[^>]*>(.*?)<\/div>/i ' , "\\1 \n" , $ plain ); // <div>with content</div>
372+
370373 // images
371374 $ plain = (string ) preg_replace (array ('/<img\s+[^>]*src="([^"]*)"[^>]*>/i ' ), "[Image: \\1] " , $ plain ); // <br> <tr>
372375
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ protected function getOriginalMessageSplitters()
2525 */
2626 static function toPlainText ($ html )
2727 {
28- $ html = str_replace ([ 'span ' , ' div ' ] , 'p ' , $ html );
28+ $ html = str_replace ('span ' , 'p ' , $ html );
2929 $ html = preg_replace ('/<div class="signature".+<\/div>/ ' ,'' , $ html );
3030 return parent ::toPlainText ($ html );
3131 }
You can’t perform that action at this time.
0 commit comments