Open yfu-caredx opened 1 year ago
Same problem for me (with DiagrammeR version 1.0.9)
Here a reproducible example
my_diag <- "graph LR
A-->B
A-->C"
DiagrammeR::DiagrammeR(my_diag) ## works as expected
write(my_diag, file = "test.mmd")
DiagrammeR::mermaid("test.mmd") ## does not work
it seems mermaid() function is unable to supporting reading from a file name, instead it shows "syntax error". subsequently, the .mmd file preview function in RStudio is also broken as it basically calls the mermaid() function to preview. I tested a simple example and it works fine as a string input to mermaid(), but when I saved it as .mmd file and use the filename as input to the function, the syntax error occurs.