diff --git a/src/routes/admin/mail/formatter.ts b/src/routes/admin/mail/formatter.ts index 138cb7a565581b790c56089a571ed3ba2354a98f..45b15c5d13a86a6c7686c292cfa8402cd43d618b 100644 --- a/src/routes/admin/mail/formatter.ts +++ b/src/routes/admin/mail/formatter.ts @@ -41,11 +41,13 @@ type Mail = { }; export function format(subject: string, content: string, user: User): Mail { + const html = md.render(content, {user}); + const css = html.includes("hljs") ? `<style>${hljsCSS}</style>` : ""; return { to: { name: user.name, address: user.email }, subject: replacePlaceholders(subject, user), text: replacePlaceholders(content, user), - html: `<style>${hljsCSS}</style>${md.render(content, {user})}` + html: css + html }; }