我尝试从美人鱼网站运行example(working copy位于codepen.io上):
<script src="https://cdn.rawgit.com/knsv/mermaid/0.5.1/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
<div class="mermaid">
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
</div>
输出结果为:
同时,sequence diagram works great。
基本示例的问题在哪里?
问题在于Chrome 48的兼容性。它是使用最新的js
文件修复的:
<script src="https://cdn.rawgit.com/knsv/mermaid/master/dist/mermaid.min.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/knsv/mermaid/master/dist/mermaid.css">