Skip to content

Commit

Permalink
Fix type conversion in sanitizeText function to ensure proper string …
Browse files Browse the repository at this point in the history
…output
  • Loading branch information
Shahir-47 committed Dec 6, 2024
1 parent df636c6 commit a6facc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit a6facc2

Please sign in to comment.