From 5e21a475a7783c46a6924efa5cf5b958a07e7ff7 Mon Sep 17 00:00:00 2001 From: iamsivin Date: Tue, 5 May 2026 12:34:11 +0530 Subject: [PATCH] chore: Clean up --- .../dashboard/helper/emailQuoteExtractor.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/javascript/dashboard/helper/emailQuoteExtractor.js b/app/javascript/dashboard/helper/emailQuoteExtractor.js index b6eead184..19476510f 100644 --- a/app/javascript/dashboard/helper/emailQuoteExtractor.js +++ b/app/javascript/dashboard/helper/emailQuoteExtractor.js @@ -141,14 +141,9 @@ const findTopLevelTailStart = root => { if (isNeutral(n)) return false; const t = nodeText(n); if (!t.trim()) return false; - // For element nodes the trigger must occupy the FIRST non-empty line — - // a container like
/ wrapping reply text ABOVE a buried
-    // header would otherwise be marked as the entire quote tail and the
-    // user's reply would be dropped with it.
-    const probe =
-      n.nodeType === ELEM
-        ? (t.split('\n').find(l => l.trim()) ?? '').trim()
-        : t;
+    // Trigger must be the FIRST non-empty line — a buried header inside
+    // a multiline node would otherwise drop the reply above it.
+    const probe = (t.split('\n').find(l => l.trim()) ?? '').trim();
     if (HARD_HEADERS.some(re => re.test(probe)) || ATTRIBUTION.test(probe)) {
       // No reply text above the trigger → could be bottom-posted. Mirror
       // the RFC branch: only fire when every following node is `>`-quoted