diff --git a/app/mail/page.tsx b/app/mail/page.tsx index 7850ae8..5e2c2f1 100644 --- a/app/mail/page.tsx +++ b/app/mail/page.tsx @@ -1128,7 +1128,26 @@ export default function MailPage() {
- {email.folder === 'INBOX' && 'Folder: INBOX'} + {(() => { + // Try to get clean preview text from the email body + let previewText = ''; + try { + // Remove HTML tags and decode entities + previewText = email.body + .replace(/<[^>]+>/g, '') // Remove HTML tags + .replace(/ /g, ' ') // Replace   with space + .replace(/\s+/g, ' ') // Normalize whitespace + .trim(); + + // Limit to a reasonable length + if (previewText.length > 100) { + previewText = previewText.substring(0, 100) + '...'; + } + } catch (e) { + previewText = ''; // Fallback to empty string if there's an error + } + return previewText || 'No preview available'; + })()}