You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hm. The problem here is that we sometimes need that div, and sometimes we don't (that's ultimately a crossref issue, where we assume a certain div structure where things like captions etc will be). It's honestly a mess. The workaround will be to search for either of the divs, but it's really an admission of defeat. We should nuke this code from orbit and start again, and I will on 1.4.
Well, it's worse. Our SCSS assumes a figure node, which we only emit for a crossreferenceable figure with id and caption. So the only way currently to make this work in 1.3 is to do something like:
```{mermaid}
%%| label: fig-1
%%| fig-cap: Mermaid diagram
%%| fig-align: center
flowchart TB
a --> b
b --> c
```
This is, in the end, just another instance of the "fig-align should work for all "figures" whether or not they're crossreferenceable" bug. I'm reluctant to change this in 1.3 because that code is very finicky and regression prone. We'll fix this in 1.4.
Following #3294 and its fix #3433
this is supposed to work
However it is not.
This is because we do in JS now
quarto-cli/src/resources/formats/html/mermaid/mermaid-init.js
Lines 215 to 224 in fbc12cb
but somehow we have more div than expected. The
layout-align
is one div above.This is the intermediate md
and the HTML rendered in preview
@cscheid I let you see this because
Discussed in #4375
Originally posted by wilcar February 16, 2023
How can I center a mermaid diagram in a html document ?
The text was updated successfully, but these errors were encountered: