Open YuanchenZhu2020 opened 4 years ago
Have you made sure that you write the code in the correct syntax?
I used the example code from Mermaid Live Editor as below and it still shows Syntax error in graph:
graph 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]
I couldn't give a screenshot because it was nearly one year ago. But I have find some possible reasons:
codeblock
. If enable it, the <div class="copy-btn">
tag will obstruct the rendering work of mermaid.js
.So I made the following changes:
return `${start}<pre><div class="mermaid">${content}</div></pre>${end}`;
I'm not familiar with hexo plugin, so I didn't submit the code. But it worked well in my blog:
Simply try modifying footer.ejs(or any ejs file that make part of
tag) in your theme folder, not after-footer.ejs in hexo-cli folder. I've figured it out in this way.
Behaviour
When I use it in hexo@5.2.0, it shows Syntax error in graph on the page.
Version
NexT version 8.0.1 hexo: 5.2.0 hexo-cli: 4.2.0 os: Windows_NT 10.0.19041 win32 x64 node: 12.18.3 mermaid.js: 8.8.1