From 82be0477087bc0ecb170aa87a7019fd37c3e2c70 Mon Sep 17 00:00:00 2001 From: Shuki Vaknin Date: Tue, 26 May 2026 19:33:48 +0300 Subject: [PATCH] fix(email-viewer): stop shattering table cells with word-break: break-word MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The global rule td, th { word-break: break-word; } was breaking HTML-email tables one glyph per row whenever a column was narrow, especially for Hebrew/Arabic/CJK headers and long English strings. The non-standard `word-break: break-word` keyword behaves like `break-all` in some engines, splitting words at arbitrary character boundaries even when the word would fit if the column auto- expanded. `overflow-wrap: break-word` is already set on body/table, so the rule only needs to add min-content relaxation for cells. `overflow-wrap: anywhere` does exactly that without re-introducing break-all behaviour. Repro: any transactional Hebrew/RTL order-summary email — each header (`מוצר`, `כמות`, `מחיר`) collapses to one glyph per row. After the fix they render on a single line. Closes #341. --- components/email/email-viewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index 1be0569b..210eb578 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -2866,7 +2866,7 @@ export function EmailViewer({ img { max-width: 100% !important; height: auto !important; } a { color: #1a73e8; } table { max-width: 100% !important; table-layout: auto; overflow-wrap: break-word; } - td, th { word-break: break-word; } + td, th { overflow-wrap: anywhere; } pre { white-space: pre-wrap; word-wrap: break-word; } ${wordHtmlCSS} ${darkModeCSS}