We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a15ca8 commit ea3aa06Copy full SHA for ea3aa06
2 files changed
src/index.ts
@@ -1,6 +1,7 @@
1
import { DEFAULT_FONT_SIZE } from "./constants.js";
2
import { graphToExcalidraw } from "./graphToExcalidraw.js";
3
import { parseMermaid } from "./parseMermaid.js";
4
+import { validateMermaid } from "./validateMermaid.js";
5
6
export interface MermaidConfig {
7
/**
@@ -60,4 +61,4 @@ const parseMermaidToExcalidraw = async (
60
61
return excalidrawElements;
62
};
63
-export { parseMermaidToExcalidraw };
64
+export { parseMermaidToExcalidraw, validateMermaid };
src/validateMermaid.ts
@@ -0,0 +1,5 @@
+import mermaid from "mermaid";
+
+export async function validateMermaid(mermaidStr: string) {
+ return mermaid.parse(mermaidStr, { suppressErrors: true });
+}
0 commit comments