You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[cfg_attr(doc, aquamarine::aquamarine)]
/// This is a comment.
///
/// This is a diagram[^1]:
/// ```mermaid
/// flowchart LR
/// A --> B
/// ```
///
/// [^1]: This is a footnote.
Found:
Expected (not including rendered diagram):
The text was updated successfully, but these errors were encountered:
The implementation of aquamarine is using the macro quote!{ #[doc = ...} to embed into the rustdoc section the newly generated mermaid rendering script-hooks. This quote! macro is embedding as block-comment instead of using line-comments. The expanded result of Aquamarine will look similar to the following minimized example:
/// This is a comment.////// This is a diagram[^1]:/** <script> const x = 1;</script>*//// [^1]: This is a footnote.pubfnexample_with_footnote(){}
It seem this block-comment is interrupting the line-comments and causing the footnote-feature to get out of sync.
If the html-code would be added using line-comments, the footnote feature would keep working as expected
/// This is a comment.////// This is a diagram[^1]:////// <script> const x = 1;</script>/// /// [^1]: This is a footnote.pubfnexample_with_footnote(){}
Either the quote! macro needs to be modified to produce line-comments or the rustdoc footnote-feature needs to be improved to cope with the switch between different comment styles.
It seems to be an issue with parsing of multi-line comments, so if the generated code would be a single line, the parser will be fine and footnotes rae respected
/// This is a comment.
///
/// This is a diagram[^1]:
/// <scriptsrc="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script><div>dff</div>
/// [^1]: This is a footnote.
But this does not go well with the mermaid markdown language, requiring multiline text within div-element
Comment blocks that utilise Mermaid's code blocks break footnote rendering, e.g.:
Found:
Expected (not including rendered diagram):
The text was updated successfully, but these errors were encountered: