Extract every Mermaid diagram from a Markdown document, or treat the whole
file as one diagram when path ends in .mmd. CRLF line endings are
normalized before scanning.
Parameters
path: string
Source path; a .mmd extension switches to whole-file mode.
Extract every Mermaid diagram from a Markdown document, or treat the whole file as one diagram when
pathends in.mmd. CRLF line endings are normalized before scanning.