mail page rest
This commit is contained in:
parent
38a507d51e
commit
de9ffd6f0a
@ -488,30 +488,22 @@ function renderEmailContent(email: Email) {
|
||||
let isHtml = false;
|
||||
|
||||
if (parsed.html) {
|
||||
content = parsed.html;
|
||||
// Use our existing MIME decoding for HTML content
|
||||
content = decodeMIME(parsed.html, 'quoted-printable', 'utf-8');
|
||||
isHtml = true;
|
||||
} else if (parsed.text) {
|
||||
content = parsed.text;
|
||||
// Use our existing MIME decoding for plain text content
|
||||
content = decodeMIME(parsed.text, 'quoted-printable', 'utf-8');
|
||||
isHtml = false;
|
||||
} else {
|
||||
// Try to extract content directly from body
|
||||
// Try to extract content directly from body using our existing functions
|
||||
const htmlMatch = email.body.match(/<html[^>]*>[\s\S]*?<\/html>/i);
|
||||
if (htmlMatch) {
|
||||
content = htmlMatch[0];
|
||||
content = decodeMIME(htmlMatch[0], 'quoted-printable', 'utf-8');
|
||||
isHtml = true;
|
||||
} else {
|
||||
content = email.body
|
||||
.replace(/<[^>]+>/g, '')
|
||||
.replace(/ /g, ' ')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/\r\n/g, '\n')
|
||||
.replace(/=\n/g, '')
|
||||
.replace(/=3D/g, '=')
|
||||
.replace(/=09/g, '\t')
|
||||
.trim();
|
||||
// Use our existing text extraction function
|
||||
content = extractTextFromHtml(email.body);
|
||||
isHtml = false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user