mirror of
https://github.com/Mail-0/Zero.git
synced 2026-06-29 15:26:42 +00:00
Fix: render HTML instead of raw code on print (#1851)
This commit is contained in:
@@ -55,14 +55,7 @@ import { useQueryState } from 'nuqs';
|
||||
import { Badge } from '../ui/badge';
|
||||
import { format } from 'date-fns';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
// HTML escaping function to prevent XSS attacks
|
||||
function escapeHtml(text: string): string {
|
||||
if (!text) return text;
|
||||
const div = document.createElement('div');
|
||||
div.textContent = text;
|
||||
return div.innerHTML;
|
||||
}
|
||||
import { cleanHtml } from '@/lib/email-utils';
|
||||
|
||||
// Add formatFileSize utility function
|
||||
const formatFileSize = (size: number) => {
|
||||
@@ -1096,7 +1089,7 @@ const MailDisplay = ({ emailData, index, totalEmails, demo, threadAttachments }:
|
||||
<!-- Email Body -->
|
||||
<div class="email-body">
|
||||
<div class="email-content">
|
||||
${escapeHtml(emailData?.decodedBody || '') || '<p><em>No email content available</em></p>'}
|
||||
${cleanHtml(emailData?.decodedBody || '')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user