From 9dfcb6bc908f2ac150e69640923a78209fd95e02 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Tue, 19 May 2026 14:56:01 +0530 Subject: [PATCH] fix: hide Gmail forward quoted text Gmail forwards wrap content in
instead of a blockquote, so the existing detector missed them. --- frontend/apps/main/src/utils/quotedContent.test.js | 8 ++++++++ frontend/shared-ui/assets/styles/main.scss | 3 ++- frontend/shared-ui/utils/quotedContent.js | 10 ++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/apps/main/src/utils/quotedContent.test.js b/frontend/apps/main/src/utils/quotedContent.test.js index ec10f36f..faf7d2c2 100644 --- a/frontend/apps/main/src/utils/quotedContent.test.js +++ b/frontend/apps/main/src/utils/quotedContent.test.js @@ -51,6 +51,14 @@ describe('containsQuoteMarkers', () => { expect(containsQuoteMarkers(html)).toBe(true) }) + test('detects Gmail forward gmail_quote_container', () => { + const html = `
+
---------- Forwarded message ---------
+
Original message body
+
` + expect(containsQuoteMarkers(html)).toBe(true) + }) + test('detects real Hotmail reply payload', () => { const html = `
Quoted reply!
diff --git a/frontend/shared-ui/assets/styles/main.scss b/frontend/shared-ui/assets/styles/main.scss index d39f9fa7..fc4f439a 100644 --- a/frontend/shared-ui/assets/styles/main.scss +++ b/frontend/shared-ui/assets/styles/main.scss @@ -311,7 +311,8 @@ [id$="_OLK_SRC_BODY_SECTION"] ~ *, [class*="_OutlookMessageHeader"], [class*="_OutlookMessageHeader"] ~ *, - [class*="_yahoo_quoted"] { + [class*="_yahoo_quoted"], + [class*="_gmail_quote_container"] { @apply hidden; } } diff --git a/frontend/shared-ui/utils/quotedContent.js b/frontend/shared-ui/utils/quotedContent.js index 2004fd53..df2f3291 100644 --- a/frontend/shared-ui/utils/quotedContent.js +++ b/frontend/shared-ui/utils/quotedContent.js @@ -3,16 +3,18 @@ // render time, so any CSS that needs to match the rendered DOM must use // attribute-suffix selectors (see .hide-quoted-text in main.scss). // -// Scope:
covers Gmail/Apple/Thunderbird. The id/class markers -// below cover the Microsoft variants (Outlook desktop/web/mac, Hotmail) -// and Yahoo Mail. +// Scope:
covers Gmail/Apple/Thunderbird *replies*. Gmail +// *forwards* wrap content in
+// instead. The id/class markers below cover the Microsoft variants +// (Outlook desktop/web/mac, Hotmail) and Yahoo Mail. export const QUOTE_MARKERS = [ ' {