mailer
mailer copied to clipboard
Improve regexps in `HtmlToTextBodyConverter`
$html = preg_replace('~<(style|script)[^>]*>.*?</\1>~is', '', $html);
// ...
// Does it make sense to remove spaces from the end of lines?
$text = preg_replace("~^[ \t]+|[ \t]+$~m", '', trim($text));
Originally posted by @Tigrov in https://github.com/yiisoft/mailer-view/pull/2#discussion_r1794502710