gitbook-plugin-mermaid-2
gitbook-plugin-mermaid-2 copied to clipboard
Code fence reg-ex does not work for CRLF line endings.
The regular expression used to find the Mermaid code fence in a markdown document does not work if the document uses CRLF
line endings (as opposed to just LF
).
Any update on this?
Sorry for replying too late, but I think this issue will be reported on https://github.com/knsv/mermaid
@morlay hi, the issue is in the plugin code, not the mermaid library.
In the first line in index.js
:
var mermaidRegex = /^```mermaid((.*\n)+?)?```$/im;
This only matches LF line endings. This means if you save your markdown files with CRLF endings, then the plugin does not find the mermaid blocks and therefore they won't be processed.