mail page fix
This commit is contained in:
parent
4bba64dff0
commit
0a290a2a46
@ -362,11 +362,19 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward'): st
|
||||
: body;
|
||||
}
|
||||
|
||||
// Convert plain text to HTML if needed
|
||||
// Convert plain text to HTML if needed, preserving line breaks
|
||||
if (!contentType.includes('text/html')) {
|
||||
content = content
|
||||
.split('\n')
|
||||
.map(line => `<p>${line}</p>`)
|
||||
.map(line => {
|
||||
// Preserve empty lines
|
||||
if (!line.trim()) return '<br>';
|
||||
// Handle quoted text
|
||||
if (line.startsWith('>')) {
|
||||
return `<p class="text-gray-600">${line}</p>`;
|
||||
}
|
||||
return `<p>${line}</p>`;
|
||||
})
|
||||
.join('');
|
||||
}
|
||||
|
||||
@ -404,7 +412,7 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward'): st
|
||||
<p><strong>Date:</strong> ${date}</p>
|
||||
<p><strong>Subject:</strong> ${email.subject}</p>
|
||||
<p><strong>To:</strong> ${Array.isArray(email.to) ? email.to.join(', ') : email.to}</p>
|
||||
<div class="mt-4">${content}</div>
|
||||
<div class="mt-4 whitespace-pre-wrap">${content}</div>
|
||||
</blockquote>
|
||||
</div>
|
||||
`;
|
||||
@ -413,7 +421,7 @@ function getReplyBody(email: Email, type: 'reply' | 'reply-all' | 'forward'): st
|
||||
<div class="prose max-w-none">
|
||||
<blockquote class="border-l-4 border-gray-300 pl-4 my-4">
|
||||
<p>On ${date}, ${email.from} wrote:</p>
|
||||
<div class="mt-4">${content}</div>
|
||||
<div class="mt-4 whitespace-pre-wrap">${content}</div>
|
||||
</blockquote>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user