simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.02k stars 132 forks source link

Mermaid Scripts not work #156

Closed yiwc closed 2 years ago

yiwc commented 2 years ago

Dear simov,

THanks for your great work. This mermaid feature looks can not work, may you have a look?

%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ff0000'}}}%%
        graph TD
          A[Christmas] -->|Get money| B(Go shopping)
          B --> C{Let me think}
          B --> G[/Another/]
          C ==>|One| D[Laptop]
          C -->|Two| E[iPhone]
          C -->|Three| F[fa:fa-car Car]
          subgraph section
            C
            D
            E
            F
            G
          end
simov commented 2 years ago

I you have to put it in a fenced code block, either mmd or mermaid one:


  ```mermaid
  graph TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    B --> G[/Another/]
    C ==>|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
    subgraph section
      C
      D
      E
      F
      G
    end
  \```
yiwc commented 2 years ago

Hi THanks for your reply. Here the inline javascript looks can not work

feckertson commented 2 years ago

The theming capability does not seem to work prior to mermaid 8.9.1 and markdown-viewer pulls in version 8.8.4. I would think markdown-viewer should just pull in the latest mermaid release, but PR #159 will also address this concern.