diff --git a/app/mail/page.tsx b/app/mail/page.tsx index ad1605b..58945e1 100644 --- a/app/mail/page.tsx +++ b/app/mail/page.tsx @@ -1347,7 +1347,7 @@ export default function MailPage() { .replace(/]*>/gi, '\n') .replace(/<\/p>/gi, '') .replace(/<[^>]+>/g, '') - .replace(/ |‌|»|«|>/g, match => { + .replace(/ |‌|»|«|>|<|&/g, match => { switch (match) { case ' ': return ' '; case '‌': return ''; @@ -1383,7 +1383,10 @@ export default function MailPage() { !line.match(/^={2,}/) && !line.match(/^This (email|message) has been/i) && !line.match(/^Disclaimer/i) && - !line.match(/^[*_-]{3,}/); + !line.match(/^[*_-]{3,}/) && + !line.match(/^Envoyé depuis/i) && + !line.match(/^Envoyé à partir de/i) && + !line.match(/^Sent from/i); }) .join('\n') .trim(); @@ -1411,13 +1414,14 @@ export default function MailPage() { } replyHeader += `\n`; } else { + // Same header format for both reply and reply all replyHeader = `\n\nOn ${formattedDate}, ${selectedEmail.from} wrote:\n`; } - // Indent the original content + // Indent the original content with proper spacing const indentedContent = originalContent .split('\n') - .map(line => `> ${line}`) + .map(line => line ? `> ${line}` : '>') // Keep empty lines as '>' for better readability .join('\n'); return `${replyHeader}${indentedContent}`;