sphinxcontrib-mermaid
sphinxcontrib-mermaid copied to clipboard
Replaced div for pre when rendering raw to avoid newline issue
I couldn't get the project working with sphinx/rst, only the graph type worked.
After switching the html node type to "pre" it finally worked for all graph types.
@h3 which version of mermaid are you using? Do you know if this work with older (let say 9.x) versions? does the aligning still work correctly ?
Tested with mermaid 9.4.3 and had the same issue.
extensions = [
"myst_parser",
"sphinxcontrib.mermaid"
]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
mermaid_version = "9.4.3"
myst_fence_as_directive = ["mermaid"]
# Test Markdown Page
```{mermaid}
graph LR
a --> b
Edit: changing div
to pre
in the html files solves the issue.
Not exactly the same issue, but some themes are minifying html, and doing so they scrumble mermaid code. It could help if the nodes were "pre", forcing them to keep the mermaid code as is.