Annotations in class diagram not working with SuperFences
See original GitHub issueSource:
classDiagram
class Foo
<<abstract>> Foo
Expected:
classDiagram
class Foo
<<abstract>> Foo
Actual:
Here’s the mkdocs.yml, if I disable SuperFences it works as expected.
site_name: Test
docs_dir: docs
plugins:
- mermaid2
markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:mermaid2.fence_mermaid
mkdocs==1.3.1 mkdocs-mermaid2-plugin==0.6.0 pymdown-extensions==9.5
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Modelling java annotations in an UML class diagram
If it is a design model that aims to communicate the big picture, it would be advisable not to show any annotations: these...
Read more >Can I write comments in UML Class diagram? - Stack Overflow
A comment is a textual annotation that can be attached to a set of elements. ... if it is clear from the context,...
Read more >Annotations - Material for MkDocs
When SuperFences is enabled, annotations can be nested inside annotations by adding the annotate class to the list item hosting the annotation content, ......
Read more >Suppress Java Annotations in Class Diagram
I'm on Mac OS X. Command + f brings up the list you mention but selecting an item in the list and pressing...
Read more >All the UML you need to know
I'm not going to invest the time in reiterating the same content here, since you have it in your notes already. Class Diagrams....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It turns out that the annotations are half escaped, resulting in unexpected HTML tag that breaks Mermaid parser:
I looked into the source of
fence_mermaid
formatter and the comment says it does not escape the Mermaid source, so I switched to the official formattersuperfences.fence_div_format
(which does escape) and then everything worked without problem.Looks like escaping the source is necessary? Then I’m wondering, what was the original purpose of not to escape? Does escaping have pitfalls?
Oh I missed that part. Thanks for the answer!
That’ll be good. 👍 Maybe also suggest user to manually escape these symbols (e.g.
<<abstract>>
) as a workaround in loose mode.