Skip to content
Snippets Groups Projects
Commit a9ebc6d6 authored by Aaron Dötsch's avatar Aaron Dötsch
Browse files

Only include hljs css in mail html if if needed

parent 514a8546
No related branches found
No related tags found
No related merge requests found
...@@ -41,11 +41,13 @@ type Mail = { ...@@ -41,11 +41,13 @@ type Mail = {
}; };
export function format(subject: string, content: string, user: User): 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 { return {
to: { name: user.name, address: user.email }, to: { name: user.name, address: user.email },
subject: replacePlaceholders(subject, user), subject: replacePlaceholders(subject, user),
text: replacePlaceholders(content, user), text: replacePlaceholders(content, user),
html: `<style>${hljsCSS}</style>${md.render(content, {user})}` html: css + html
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment