Open di opened 2 years ago
would be very nice, because gitlab renders mermaid too
Relevant, possibly use sandbox
mode to begin with on the UI rendering side. https://github.com/mermaid-js/mermaid/blob/4b78a2106d72f0a1a0c03acc71bfdfdd8795db3b/docs/usage.md#enabling-click-event-and-tags-in-nodes
Rendering multiline code blocks with language tag mermaid
to a pre
tag in html and adding the JavaScript given in this example taken from python-markdown2
should work.
If both are wrapped in a iframe
it might be more secure when serving the mermaid.js
library from an external CDN (e.g. jsdelivr). However the library probably would be requested several times when using more than one mermaid diagram.
As mathjax
is currently served by the same CDN it might not be an issue.
Github has announced support for diagram generation via https://github.com/mermaid-js/mermaid: https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/
Given how many users use the same README for both PyPI and GitHub, we should explore how we could support this.
Here's the relevant parts for how GitHub does it: