mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 21:09:50 +02:00
Cleanup
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
import type { DiagramDetector } from '../../diagram-api/types';
|
|
||||||
import type { ExternalDiagramDefinition } from '../../diagram-api/types';
|
|
||||||
|
|
||||||
const id = 'flowchart';
|
|
||||||
|
|
||||||
const detector: DiagramDetector = (txt, config) => {
|
|
||||||
// If we have confired to only use new flow charts this function shohuld always return false
|
|
||||||
// as in not signalling true for a legacy flowchart
|
|
||||||
if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') return false;
|
|
||||||
return txt.match(/^\s*graph/) !== null;
|
|
||||||
};
|
|
||||||
|
|
||||||
const loader = async () => {
|
|
||||||
const { diagram } = await import('./flowDiagram');
|
|
||||||
return { id, diagram };
|
|
||||||
};
|
|
||||||
|
|
||||||
const plugin: ExternalDiagramDefinition = {
|
|
||||||
id,
|
|
||||||
detector,
|
|
||||||
loader,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default plugin;
|
|
Reference in New Issue
Block a user