Skip to content

Commit

Permalink
docs: mermaid duplicated id, see #504 (#685)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
upupming authored and QingWei-Li committed Nov 6, 2018
1 parent cc79e2e commit a72e749
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ window.$docsify = {
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>

var num = 0;
mermaid.initialize({ startOnLoad: false });

window.$docsify = {
Expand All @@ -44,7 +45,7 @@ window.$docsify = {
code: function(code, lang) {
if (lang === "mermaid") {
return (
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
'<div class="mermaid">' + mermaid.render('mermaid-svg-' + num++, code) + "</div>"
);
}
return this.origin.code.apply(this, arguments);
Expand Down

1 comment on commit a72e749

@SidVal
Copy link
Member

@SidVal SidVal commented on a72e749 Nov 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-🇪🇸 updated: docsifyjs/docs-es@d717f06

Please sign in to comment.