mersinvald / aquamarine

Inline diagrams for rustdoc with mermaid.js
MIT License
507 stars 28 forks source link

Aquamarine 0.3.x is broken #44

Closed dashdeckers closed 11 months ago

dashdeckers commented 1 year ago

When I use aquamarine = "0.3.2" the Mermaid diagram does not render and instead shows this error:

image

You can also see this on the demo crate when you go to the latest version. The demo crate docs.rs links for versions 0.2.0 up to and including 0.3.0 are broken (build failed), but when testing in my own repo I can say that 0.3.0 is also broken but 0.2.2 works fine.

mersinvald commented 11 months ago

It looks like mermaidjs update doesn't allow dots inside inline strings anymore:

This doesn't work

/// ```mermaid
/// graph LR
///     s([Source]) --> a[[aquamarine]]
///     r[[rustdoc]] --> f([Docs w/ Mermaid!])
///     subgraph rustc[Rust Compiler]
///     a -. inject mermaid.js .-> r
///     end
/// ```
///
ERROR :  Error parsing Error: Lexical error on line 5. Unrecognized text.
... a -. inject mermaid.js .-> r    end

This works

/// ```mermaid
/// graph LR
///     s([Source]) --> a[[aquamarine]]
///     r[[rustdoc]] --> f([Docs w/ Mermaid!])
///     subgraph rustc[Rust Compiler]
///     a -. "inject mermaid.js" .-> r
///     end
/// ```
///

I'll update the demo examples with a fix, but otherwise there doesn't seem to be a bug to fix, it's just the mermaid definitions that are broken

mersinvald commented 11 months ago

Fixed in 0.3.3