my code for replacing mermaid content: ```javascript const mermaidNodes = document.getElementsByClassName('language-mermaid'); const stackedit = new Stackedit(); for(var node of mermaidNodes) { var fileName = Math.random().toString(36).substring(2, 10); var completeContent = '\`\`\`mermaid\n' + node.innerText + '\n\`\`\`'; console.log(completeContent); stackedit.openFile({ name: fileName, content: { text: completeContent, properties: { extensions: { mermaid: { enabled: true } } } } }, true); stackedit.on('fileChange', (file) => { console.log(file.content.html); }); } ``` - **console.log(completeContent);** got sth like: ```mermaid graph LR A --> B ``` ```mermaid graph TD A --> C ``` - **console.log(file.content.html);** got sth like: ``` <pre><code class="prism language-mermaid">graph TD A --> C </code></pre> ``` - **expected result**: complete mermaid svg code instead of original code style
Activity
rhinenoir commentedon Apr 12, 2018
any plan to fix the bug?
para2402 commentedon Apr 26, 2018
Same problem.
@garenfeather What does your code do?
Were you successful getting SVG of the mermaid markdown with the above code?
para2402 commentedon Apr 27, 2018
I found a workaround for the problem. I searched for all KaTeX and mermaid HTML elements, and rendered them using Katex and mermaid libraries.
Code is here https://github.com/jaipara/StackeditJS-example.git
Hope it helps.
[-]support mermaid render now?[/-][+]Mermaid and Katex not rendered[/+]rhinenoir commentedon Jun 30, 2018
@benweet so any plan to fix the bugs?