Skip to content

Commit a72e749

Browse files
upupmingQingWei-Li
authored andcommitted
docs: mermaid duplicated id, see #504 (#685)
Please makes sure these boxes are checked before submitting your PR, thank you! * [x] Make sure you are merging your commits to `master` branch. * [x] Add some descriptions and refer relative issues for you PR. * [x] DO NOT include files inside `lib` directory.
1 parent cc79e2e commit a72e749

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: docs/markdown.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ window.$docsify = {
3636
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
3737
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
3838

39+
var num = 0;
3940
mermaid.initialize({ startOnLoad: false });
4041

4142
window.$docsify = {
@@ -44,7 +45,7 @@ window.$docsify = {
4445
code: function(code, lang) {
4546
if (lang === "mermaid") {
4647
return (
47-
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
48+
'<div class="mermaid">' + mermaid.render('mermaid-svg-' + num++, code) + "</div>"
4849
);
4950
}
5051
return this.origin.code.apply(this, arguments);

0 commit comments

Comments
 (0)