Comments (5)
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 formatter superfences.fence_div_format
(which does escape) and then everything worked without problem.
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_div_format
Looks like escaping the source is necessary? Then I'm wondering, what was the original purpose of not to escape? Does escaping have pitfalls?
from mkdocs-mermaid2-plugin.
Thank you for your contribution! This is very appreciated.
from mkdocs-mermaid2-plugin.
That's a thought-provoking question 🤔. I will look into it.
from mkdocs-mermaid2-plugin.
The custom mermaid2.fence_mermaid
was developed specifically for the loose security mode, which allows tags in text and clicking (it's stated in the code of the fence.py
.
When using tags in text, you don't want to escape your HTML .
But if you are operating in the default strict mode (no tags in text and no clickable links), escaping might indeed be better.
🤔 Perhaps I should document this better?
from mkdocs-mermaid2-plugin.
Oh I missed that part. Thanks for the answer!
Perhaps I should document this better?
That'll be good. 👍 Maybe also suggest user to manually escape these symbols (e.g. <<abstract>>
) as a workaround in loose mode.
from mkdocs-mermaid2-plugin.
Related Issues (20)
- Unhandled exception when checking if URL exists HOT 6
- mermaid 10 is incompatible HOT 9
- Unneccesary inclusion of mkdocs-material HOT 7
- Add support for mermaid gitgraph (make plugin compatible with mermaid lib > 10) HOT 2
- sequenceDiagram brokens HOT 5
- Superfences custom fence function does not seem to work HOT 14
- Cannot get theme to work on 10.2.4 HOT 3
- extra_javascript in mkdocs 1.5.0 is list of objects and no longer string HOT 5
- mkdocs build command prints deprecation warnings HOT 8
- Arguments in the config file do not work
- Tag the source HOT 3
- Include local `mermaid` library for offline support HOT 18
- javascript parameter seems not to work with default configuration HOT 5
- Mermaid2 diagrams with annotations shows half the (+) button and nothing happens when you click it HOT 9
- Markdown inside of node text is not rendering HOT 2
- Local Mermaid library not found HOT 11
- Handle module style inclusion of local Mermaid v10 library HOT 10
- Rendering Mermaid diagram with Pan and Zoom ability on mkdocs pages HOT 4
- Warnings in webdoc, because of relative links HOT 4
- [doc/readthedoc.io] link error in index HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-mermaid2-plugin.