Improve trailing spurious breaks + tests
This commit is contained in:
parent
9a530a72f6
commit
832da062cc
3 changed files with 63 additions and 22 deletions
|
@ -250,7 +250,7 @@ function parseHtmlMessage(html, partCreator, isQuotedMessage) {
|
|||
}
|
||||
|
||||
export function parsePlainTextMessage(body, partCreator, isQuotedMessage) {
|
||||
const lines = body.split(/\r\n|\r|\n/g); // split on any new-line combination not just \n
|
||||
const lines = body.split(/\r\n|\r|\n/g); // split on any new-line combination not just \n, collapses \r\n
|
||||
const parts = lines.reduce((parts, line, i) => {
|
||||
if (isQuotedMessage) {
|
||||
parts.push(partCreator.plain(QUOTE_LINE_PREFIX));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue