Closed mkiddTempus closed 5 years ago
Provided examples do not render when used in markdown file using mermaid 7.1.2 (install defaults to 8.0.0 by mistake it seems) and docsify 4.8.6.
Have a docsify site that uses a navbar and sidebar, provide the
A graph definition like:
graph TD; A --> B;
renders as plain text instead of a graph.
Mermaid correctly draws an svg graph.
Here is the full docsify set up I tried:
Attempted to use the provided method in the docs as well as a few hacks found on the web:
<script> var mermaids = document.getElementsByClassName('language-mermaid'); console.log('mermaids count: ', mermaids.length); while(mermaids.length > 0) { mermaids[0].className = 'mermaid'; } </script>
The above would never run as the document never contained any language-mermaid classes.
language-mermaid
<script> function makeid(len) { var text = new Array(len); var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for (var i = 0; i < len; i++) text[i] = possible.charAt(Math.floor(Math.random() * possible.length)); console.log('text: ' + text); return text.join(""); } window.$docsify = { name: "My Site", repo: "https://github.com/mycompany/mysite", markdown: { renderer: { code: function(code, lang) { var id = makeid(10); console.log('lang: ' + lang); if (lang === "mermaid") { console.log("I ran for lang==+mermaid"); return ( '<div class="mermaid">' + mermaid.render('mermaid-svg-' + id, code) + '</div>' ); } else { console.log("welp") } return this.origin.code.apply(this, arguments); } } }, loadNavbar: "sidebar.md", loadSidebar: "sidebar.md", maxLevel: 100, subMaxLevel: 100, auto2top: true, coverpage: "coverpage.md", homepage: "home.md", logo: "/my.png", themeColor: "rgb(57, 171, 209)", alias: { "/.*/sidebar.md": "/sidebar.md" }, search: { maxAge: location.hostname === "localhost" ? 0 : 3600000, // 1 hr expiration IRL, 0 in dev depth: 6, // max indexing depth hideOtherSidebarContent: true, namespace: "mysite" } }; </script>
[ ] Bug does still occur when all/other plugins are disabled?
Your OS:
Node.js version: v11.8.0
npm/yarn version: v6.5.0
Browser version: Chrome Version 73.0.3683.103
Docsify version: 4.8.6
Docsify plugins: None? We have some css and two custom js files for a footer and history.
Issue is the docs themselves as they don't show to wrap the intended SVG text in a div but the mermaid docs do here: https://mermaidjs.github.io/usage.html
Bug Report
Provided examples do not render when used in markdown file using mermaid 7.1.2 (install defaults to 8.0.0 by mistake it seems) and docsify 4.8.6.
Steps to reproduce
Have a docsify site that uses a navbar and sidebar, provide the
What is current behaviour
A graph definition like:
renders as plain text instead of a graph.
What is the expected behaviour
Mermaid correctly draws an svg graph.
Other relevant information
Here is the full docsify set up I tried:
Attempted to use the provided method in the docs as well as a few hacks found on the web:
The above would never run as the document never contained any
language-mermaid
classes.[ ] Bug does still occur when all/other plugins are disabled?
Your OS:
Node.js version: v11.8.0
npm/yarn version: v6.5.0
Browser version: Chrome Version 73.0.3683.103
Docsify version: 4.8.6
Docsify plugins: None? We have some css and two custom js files for a footer and history.