mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-31 14:16:42 +02:00

there is no need for matching, capturing results, and validating nullablity just using `.test` would be enough and significantly faster for more info, see https://stackoverflow.com/10940138/16476610
21 lines
374 B
TypeScript
21 lines
374 B
TypeScript
import type { ExternalDiagramDefinition } from 'mermaid';
|
|
|
|
const id = 'zenuml';
|
|
|
|
const detector = (txt: string) => {
|
|
return /^\s*zenuml/.test(txt);
|
|
};
|
|
|
|
const loader = async () => {
|
|
const { diagram } = await import('./zenuml-definition.js');
|
|
return { id, diagram };
|
|
};
|
|
|
|
const plugin: ExternalDiagramDefinition = {
|
|
id,
|
|
detector,
|
|
loader,
|
|
};
|
|
|
|
export default plugin;
|