Closed elgalu closed 9 months ago
Thanks for your message. I am not sure what I can do from my level of expertise, since the plugin merely calls the mermaid.js library.
But looking at the HTML page actually generated, I see something a bit weird in it:
<div class="highlight"><pre><span></span><code><div class="annotate" markdown>
<span class="sb">```mermaid</span>
<span class="s">graph TD</span>
<span class="s">A[Client (1)] --> B[Server]</span>
<span class="sb">```</span>
</div>
At least, we have a clue on why the tag is not executed.
One thing I might advise you (just in case) would be to skip a line between the div and the triple quotes:
<div class="annotate" markdown>
```mermaid
graph TD
A[Client (1)] --> B[Server]
```
</div>
Thanks. Yeah I tried all sort of combinations wrt adding/removing between the div and the triple quotes.
If you remove the <div>
, it will work, right?
Here is what I would do, if I were you: deactivate the mermaid2 plugin, and then see if you see the same anomaly in the HTML generated (i.e. the HTML markers are transformed into entities)?
Do that while keeping the mermaid2 custom-fence; and then change it to the standard recommended for Material. That should give us more information on where the problem comes from.
Thanks, added to the demo Without the div, annotate does nothing
The point now is to determine who could help you since it is a "holistic" problem of multiple interactions that involves:
So, where does the problem come from?
Perhaps a problem to be discussed on mkdocs/community?
yeah I also raised it at https://github.com/mermaid-js/mermaid/issues/4865
Here is @squidfunk's advice on the community room:
Annotations are not supported in Mermaid diagrams. Reason: with Mermaid, you're in SVG space, which has entirely different layout and positioning semantics than HTML. It is probably possible to make it work, but from my research trying to make tooltips work in SVG, it's quite an effort.
Should we consider this an issue or a discussion?
yes, we can keep it in the community room, closing.
Hi, thanks a lot for this plugin, it's extremely useful<3
The mkdocs.yml -> features:
content.code.annotate
almost works except that the button is half-visible and more importantly click doesn't trigger the annotation even withsecurityLevel: loose
Please find a minimal working example with code at: Demo: https://elgalu.github.io/mermaid2-content.code.annotate/ Code: https://github.com/elgalu/mermaid2-content.code.annotate/