badboy / mdbook-mermaid

A preprocessor for mdbook to add mermaid support
Mozilla Public License 2.0
306 stars 32 forks source link

Markdown files with CR LF line endings instead of LF do not create mermaid output #26

Closed pseiko1989 closed 1 year ago

pseiko1989 commented 1 year ago

Markdown files with CR-LF line endings will only create an empty

<pre class="mermaid">
</pre>

instead of the code block.

It should be possible to verify it with the following files: test_cr_lf.md test_lf.md

The cause of this may be that events.into_offset_iter() in https://github.com/badboy/mdbook-mermaid/blob/main/src/lib.rs#L64 returns the mermaid content line by line instead of in one big chunk.

badboy commented 1 year ago

PRs welcome. I don't have CRLF line endings, so I'm not too eager to investigate this right now.