26 lines
567 B
TypeScript
26 lines
567 B
TypeScript
import type { MermaidConfig } from "mermaid";
|
|
|
|
export const MERMAID_SECURE_CONFIG_KEYS = [
|
|
"secure",
|
|
"securityLevel",
|
|
"startOnLoad",
|
|
"maxTextSize",
|
|
"maxEdges",
|
|
"suppressErrorRendering",
|
|
"themeCSS"
|
|
];
|
|
|
|
export function createMermaidSiteConfig(): MermaidConfig {
|
|
return {
|
|
startOnLoad: false,
|
|
securityLevel: "strict",
|
|
theme: "default",
|
|
look: "classic",
|
|
fontFamily: "Segoe UI, Microsoft YaHei, sans-serif",
|
|
maxTextSize: 50_000,
|
|
maxEdges: 500,
|
|
suppressErrorRendering: true,
|
|
secure: [...MERMAID_SECURE_CONFIG_KEYS]
|
|
};
|
|
}
|