Scope DOMPurify config to call sites

Replace global setConfig with an exported sanitizeConfig passed
inline. The global config leaked into mermaid's internal
strict-mode sanitization, stripping valid SVG diagrams.
This commit is contained in:
Rūdolfs Ošiņš
2026-05-07 18:31:28 +02:00
parent faadd2906b
commit 9e268d9ac0
6 changed files with 24 additions and 13 deletions
+3 -2
View File
@@ -18,7 +18,7 @@
canonicalize,
isCommit,
} from "@app/lib/utils";
import { Renderer, markdown } from "@app/lib/markdown";
import { Renderer, markdown, sanitizeConfig } from "@app/lib/markdown";
export let content: string;
export let path: string = "/";
@@ -97,7 +97,8 @@
renderer: new Renderer($activeUnloadedRouteStore),
breaks,
}) as string,
);
sanitizeConfig,
) as string;
}
afterUpdate(async () => {