From cb9f27da9a8b4940760e37e5238a1eb91e427daf Mon Sep 17 00:00:00 2001 From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:44:52 +0000 Subject: [PATCH] fix mermaid security (#1774) --- .../src/features/editor/components/code-block/mermaid-view.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/client/src/features/editor/components/code-block/mermaid-view.tsx b/apps/client/src/features/editor/components/code-block/mermaid-view.tsx index e871e2f4..d0109d09 100644 --- a/apps/client/src/features/editor/components/code-block/mermaid-view.tsx +++ b/apps/client/src/features/editor/components/code-block/mermaid-view.tsx @@ -5,6 +5,7 @@ import { v4 as uuidv4 } from "uuid"; import classes from "./code-block.module.css"; import { useTranslation } from "react-i18next"; import { useComputedColorScheme } from "@mantine/core"; +import DOMPurify from "dompurify"; interface MermaidViewProps { props: NodeViewProps; @@ -37,7 +38,7 @@ export default function MermaidView({ props }: MermaidViewProps) { .catch((err) => { if (props.editor.isEditable) { setPreview( - `