chore: enable markdown for platform atoms (#18069)

* chore: enable markdown for platform atoms

* fixup! chore: enable markdown for platform atoms
This commit is contained in:
Morgan authored and GitHub committed 2024-12-09 16:11:02 +02:00
1 parent 49c97c6380
commit 15e93af2ac
2 files changed
+8 -2

No files matched your search

@@ -1,5 +1,9 @@
import DOMPurify from "dompurify";
import { marked } from "marked";
export function markdownToSafeHTML(markdown: string | null) {
if (!markdown) return "";
return markdown;
marked.use({ async: false });
const parsedMd = marked.parse(markdown) as string;
return DOMPurify.sanitize(parsedMd);
}
+2
View File
@@ -63,6 +63,8 @@
"@tanstack/react-query": "^5.17.15",
"class-variance-authority": "^0.4.0",
"clsx": "^2.0.0",
"dompurify": "^3.2.3",
"marked": "^15.0.3",
"react-use": "^17.4.2",
"tailwind-merge": "^1.13.2",
"tailwindcss": "^3.3.3",