Skip to content

Commit

Permalink
Message::buildText(): Trim each text line. (#84)
Browse files Browse the repository at this point in the history
Co-authored-by: David Grudl <[email protected]>
  • Loading branch information
janbarasek and dg committed Jun 2, 2021
1 parent d06b1a1 commit 0825a07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Mail/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ protected function buildText(string $html): string
]);
$text = Nette\Utils\Html::htmlToText($html);
$text = Strings::replace($text, '#[ \t]+#', ' ');
$text = implode("\n", array_map('trim', explode("\n", $text)));
return trim($text);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Příliš žluťoučký <http://green.example.com>
žlutý kůň <http://horse.example.com>
žlutý kůň <http://horse.example.com>
----------%S%
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
Expand Down

0 comments on commit 0825a07

Please sign in to comment.