From a6facc21387f2015abf9e6ec59443d092d597108 Mon Sep 17 00:00:00 2001 From: Shahir Ahmed Date: Thu, 5 Dec 2024 19:12:34 -0500 Subject: [PATCH] Fix type conversion in sanitizeText function to ensure proper string output --- packages/mermaid/src/diagrams/common/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/common/common.ts b/packages/mermaid/src/diagrams/common/common.ts index fd76d0a45d..dc37024b1a 100644 --- a/packages/mermaid/src/diagrams/common/common.ts +++ b/packages/mermaid/src/diagrams/common/common.ts @@ -83,7 +83,7 @@ export const sanitizeText = (text: string, config: MermaidConfig): string => { return text; } if (config.dompurifyConfig) { - text = DOMPurify.sanitize(sanitizeMore(text, config), config.dompurifyConfig).toString(); + text = String(DOMPurify.sanitize(sanitizeMore(text, config), config.dompurifyConfig)); } else { text = DOMPurify.sanitize(sanitizeMore(text, config), { FORBID_TAGS: ['style'],