mjbvz / vscode-markdown-mermaid

Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
MIT License
648 stars 119 forks source link

error when using ::: but not ```? #83

Closed o-o00o-o closed 3 years ago

o-o00o-o commented 3 years ago

For the exact same diagram I get an error if I use ::: but not if I use ```. Doesn't seem likely but true!

This works. Switch the ``` for ::: and it doesn't.

graph TB

    SDS(Data Sources)
    Users((Users))
    ExtProc(External Processes)
    MDS[MDS]

    ExtProc --> SDS    
    Users --> SDS
    Users --"Tables where Users are owner"--> MDS

    subgraph SSIS
        EtlPreE(Etl Pre Extract) -.-> EtlE
        EtlE(Etl Extract) -.-> EtlPreL
        EtlPreL(Etl Pre Load) -.-> EtlL
        EtlL(Etl Load) -.-> EtlPstL
        EtlPstL(Etl Post Load)
    end

    subgraph DW
        DWS[Dw Staging]
        DWK[Dw Star Schema]

        EtlE --> DWS
        EtlPreL -- bad etls that don't extract--> DWK
        EtlL --> DWK
        DWS -.-> DWK
    end

    subgraph Deploy
        SSDTPD(Post Deploy)
    end

    SSDTPD --"Tables where System is owner (static)"--> MDS
    SDS --> EtlE
    SDS --> EtlPreE
    EtlPreE --"Tables where MDS is Data Integrator for Data Stewards"--> MDS
    MDS --> EtlE
    EtlPstL --"Tables where DW is owner (dynamic)"--> MDS
ajdajd commented 3 years ago

I've encountered this error and I believe the difference is the whitespaces. That is:

``` mermaid
graph TD
    subgraph sub1
    A --> B
    end

    C --> B

and

::: mermaid graph TD subgraph sub1 A --> B end C --> B :::



The Azure Wiki renderer doesn't seem to mind the whitespaces.

I do end up switching back and forth because the [syntax highlighter](https://github.com/bpruitt-goddard/vscode-mermaid-syntax-highlight) only supports backticks. And it's easier to edit with whitespaces.