fix: visual editor preview

This commit is contained in:
Mikkel Svartveit
2026-03-11 14:04:47 +01:00
parent 57bfbf874b
commit 4451e921ca
4 changed files with 382 additions and 460 deletions
+2 -2
View File
@@ -652,7 +652,7 @@ export class EmailService {
/**
* Detects if HTML contains custom patterns that indicate it was written in the HTML editor
* rather than the visual editor. Mirrors the same logic in EmailPreviewModal.tsx.
* rather than the visual editor. Mirrors the same logic in apps/web/src/lib/emailStyles.ts.
*/
private static detectCustomHtmlPatterns(html: string): boolean {
if (!html || html.trim() === '') return false;
@@ -692,7 +692,7 @@ export class EmailService {
/**
* Wraps visual editor content with a full HTML document and prose styles.
* Mirrors wrapEmailWithStyles() in EmailPreviewModal.tsx so sent emails
* Mirrors wrapEmailWithStyles() in apps/web/src/lib/emailStyles.ts so sent emails
* match the preview modal exactly.
*/
private static wrapWithEmailStyles(htmlBody: string): string {