diff --git a/package.json b/package.json index 7629b0bc4d..612e866e7c 100644 --- a/package.json +++ b/package.json @@ -170,7 +170,7 @@ "react-window": "^1.8.6", "reakit": "^1.3.6", "regenerator-runtime": "^0.13.7", - "rich-markdown-editor": "^11.11.1", + "rich-markdown-editor": "^11.12.0-0", "semver": "^7.3.2", "sequelize": "^6.3.4", "sequelize-cli": "^6.2.0", diff --git a/server/emails/DocumentNotificationEmail.js b/server/emails/DocumentNotificationEmail.js index 868dcfb307..71b44f4357 100644 --- a/server/emails/DocumentNotificationEmail.js +++ b/server/emails/DocumentNotificationEmail.js @@ -1,5 +1,6 @@ // @flow import * as React from "react"; +import theme from "../../shared/styles/theme"; import { User, Document, Team, Collection } from "../models"; import Body from "./components/Body"; import Button from "./components/Button"; @@ -73,3 +74,39 @@ export const DocumentNotificationEmail = ({ ); }; + +export const css = ` + ins { + background-color: #128a2929; + text-decoration: none; + } + + del { + background-color: ${theme.slateLight}; + color: ${theme.slate}; + text-decoration: strikethrough; + } + + ul { + padding-left: 0; + } + + .checkbox-list-item { + list-style: none; + padding: 4px 0; + margin: 0; + } + + .checkbox { + font-size: 0; + display: block; + float: left; + white-space: nowrap; + width: 12px; + height: 12px; + margin-top: 2px; + margin-right: 8px; + border: 1px solid ${theme.textSecondary}; + border-radius: 3px; + } +`; diff --git a/server/emails/components/EmailLayout.js b/server/emails/components/EmailLayout.js index 78f65f29b1..ee7d1cd55a 100644 --- a/server/emails/components/EmailLayout.js +++ b/server/emails/components/EmailLayout.js @@ -23,15 +23,4 @@ export const baseStyles = ` font-size: 16px; line-height: 1.5; } - - ins { - background-color: #128a2929; - text-decoration: none; - } - - del { - background-color: ${theme.slateLight}; - color: ${theme.slate}; - text-decoration: strikethrough; - } `; diff --git a/server/mailer.js b/server/mailer.js index 659c8d6ea7..7189041601 100644 --- a/server/mailer.js +++ b/server/mailer.js @@ -13,6 +13,7 @@ import { type Props as DocumentNotificationEmailT, DocumentNotificationEmail, documentNotificationEmailText, + css as documentNotificationEmailCSS, } from "./emails/DocumentNotificationEmail"; import { ExportEmail, exportEmailText } from "./emails/ExportEmail"; import { @@ -148,6 +149,7 @@ export class Mailer { title: `“${opts.document.title}” ${opts.eventName}`, previewText: `${opts.actor.name} ${opts.eventName} a document`, html: , + headCSS: documentNotificationEmailCSS, text: documentNotificationEmailText(opts), }); }; diff --git a/server/utils/markdownDiff.js b/server/utils/markdownDiff.js index 0a2683d89b..05f8d9ddf8 100644 --- a/server/utils/markdownDiff.js +++ b/server/utils/markdownDiff.js @@ -1,5 +1,5 @@ // @flow -import { findLastIndex } from "lodash"; +import { findIndex, findLastIndex } from "lodash"; import diff from "node-htmldiff"; import { renderToHtml } from "rich-markdown-editor"; @@ -28,9 +28,9 @@ export default function markdownDiff( // so we can chop around those lines rather than return the entire document. let lines = diffHtml.split("\n"); - const firstChangedLineIndex = findLastIndex( + const firstChangedLineIndex = findIndex( lines, - (value) => value.includes("") || value.includes("") + (value) => value.includes("