From what I gather I should be able to write the following in markdown
```
graph TD;A-->B;A-->C;B-->D;C-->D;
```
and have it render
FLOWCHART / DIAGRAM IS DRAWN HERE
What am I missing?
Documentvar renderer = new marked.Renderer();
renderer.code = function (code, language) {
if(code.match(/^sequenceDiagram/)||code.match(/^graph/)){
return '
}
};
$(document).ready(function(){
$.get( "test.md", function( data ) {
// console.log(data);
$('#content').html(marked(data));
});
});
console.log(marked('```graph TD;A-->B;A-->C;B-->D;C-->D;```', { renderer: renderer }));
解决方案
I tested your code as far as to get the console.log writing the mermaid div.
There is nothing wrong with your marked instantiation and nothing wrong with your renderer. However... the markdown in the console log was not ok.
By adding new lines before and after the graph definition the expeced div was printed to the console.:
\ngraph TD;A-->B;A-->C;B-->D;C-->D;\n
I hope this helps.
/Knut