Detect a Mermaid diagram's type from its source by reading the first non-blank, non-comment line's leading keyword (e.g. flowchart, sequenceDiagram). Returns 'unknown' for empty or unrecognizable input.
flowchart
sequenceDiagram
'unknown'
Raw diagram source.
The diagram-type keyword, or 'unknown'.
Detect a Mermaid diagram's type from its source by reading the first non-blank, non-comment line's leading keyword (e.g.
flowchart,sequenceDiagram). Returns'unknown'for empty or unrecognizable input.