The regex used to match the start of a mermaid diagram doesn't work if there are comments at the beginning of a diagram.
For example:
```mermaid
%% Debug using mermaid.live
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
Modifying it to the following may fix the issue
`const mermaidStart =
/(?:%%[^\n]*\n)*\s*(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Context|C4Container|C4Component|C4Dynamic|C4Deployment|timeline)/;`
The regex used to match the start of a mermaid diagram doesn't work if there are comments at the beginning of a diagram.
For example: