Neah version mail forward fix 3

This commit is contained in:
alma 2025-04-16 20:06:42 +02:00
parent 8dd78f4bfb
commit 60168e70f7

View File

@ -1347,7 +1347,7 @@ export default function MailPage() {
.replace(/<p[^>]*>/gi, '\n') .replace(/<p[^>]*>/gi, '\n')
.replace(/<\/p>/gi, '') .replace(/<\/p>/gi, '')
.replace(/<[^>]+>/g, '') .replace(/<[^>]+>/g, '')
.replace(/&nbsp;|&zwnj;|&raquo;|&laquo;|&gt;/g, match => { .replace(/&nbsp;|&zwnj;|&raquo;|&laquo;|&gt;|&lt;|&amp;/g, match => {
switch (match) { switch (match) {
case '&nbsp;': return ' '; case '&nbsp;': return ' ';
case '&zwnj;': return ''; case '&zwnj;': return '';
@ -1383,7 +1383,10 @@ export default function MailPage() {
!line.match(/^={2,}/) && !line.match(/^={2,}/) &&
!line.match(/^This (email|message) has been/i) && !line.match(/^This (email|message) has been/i) &&
!line.match(/^Disclaimer/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') .join('\n')
.trim(); .trim();
@ -1411,13 +1414,14 @@ export default function MailPage() {
} }
replyHeader += `\n`; replyHeader += `\n`;
} else { } else {
// Same header format for both reply and reply all
replyHeader = `\n\nOn ${formattedDate}, ${selectedEmail.from} wrote:\n`; replyHeader = `\n\nOn ${formattedDate}, ${selectedEmail.from} wrote:\n`;
} }
// Indent the original content // Indent the original content with proper spacing
const indentedContent = originalContent const indentedContent = originalContent
.split('\n') .split('\n')
.map(line => `> ${line}`) .map(line => line ? `> ${line}` : '>') // Keep empty lines as '>' for better readability
.join('\n'); .join('\n');
return `${replyHeader}${indentedContent}`; return `${replyHeader}${indentedContent}`;