From 410fbad5b5c4259ccf5014ca0d264b40269a4ffc Mon Sep 17 00:00:00 2001 From: Sergei Zharinov Date: Tue, 5 May 2026 09:31:30 -0300 Subject: [PATCH] fix(ui): preserve SVG tags in DOMPurify config for KaTeX math rendering --- packages/ui/src/components/markdown.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index 56e2d9d7094f..7ee73af10f3d 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -33,6 +33,8 @@ const config = { SANITIZE_NAMED_PROPS: true, FORBID_TAGS: ["style"], FORBID_CONTENTS: ["style", "script"], + ADD_TAGS: ["svg", "path"], + ADD_ATTR: ["d", "viewBox", "preserveAspectRatio", "xmlns"], } const iconPaths = {