diff --git a/app/src/services/quoted-html-transformer.ts b/app/src/services/quoted-html-transformer.ts index 55235c0ec..aa6c18ae0 100644 --- a/app/src/services/quoted-html-transformer.ts +++ b/app/src/services/quoted-html-transformer.ts @@ -105,12 +105,13 @@ class QuotedHTMLTransformer { return; } - // Find back-to-back

at the top level and de-duplicate them - const { children } = doc.body; + // Find back-to-back

at the top level and de-duplicate them. Note that + // some emails contain TEXT
TEXT
TEXT, so the only ELEMENT children may be the + const nodes = doc.body.childNodes; const extraTailBrTags = []; - for (let i = children.length - 1; i >= 0; i--) { - const curr = children[i]; - const next = children[i - 1]; + for (let i = nodes.length - 1; i >= 0; i--) { + const curr = nodes[i]; + const next = nodes[i - 1]; if (curr && curr.nodeName === 'BR' && next && next.nodeName === 'BR') { extraTailBrTags.push(curr); } else {