Initial attempt to make toggleInlineFormat paragraph-aware

This commit is contained in:
Michael Telatynski 2020-01-21 15:32:32 +00:00
parent adec308529
commit b2aba6db35
5 changed files with 221 additions and 27 deletions

View file

@ -250,7 +250,7 @@ function parseHtmlMessage(html, partCreator, isQuotedMessage) {
}
export function parsePlainTextMessage(body, partCreator, isQuotedMessage) {
const lines = body.split("\n");
const lines = body.split(/\r\n|\r|\n/g); // split on any new-line combination not just \n
const parts = lines.reduce((parts, line, i) => {
if (isQuotedMessage) {
parts.push(partCreator.plain(QUOTE_LINE_PREFIX));