Open MaikPoetzsch opened 3 months ago
Thanks for the report.
You have not closed properly one of your code block, you probably used not the same number of backticks or none.
Interestingly, using a R Code Cell to run Mermaid with DiagrammeR package works fine.
:::{.callout-note collapse=”true”}
# Mermaid in R cell inside a Callout Block collapse is true
```{r}
#| echo: false
install.packages("DiagrammeR", repos="http://cran.us.r-project.org", quiet = TRUE)
suppressWarnings(library("DiagrammeR"))
## Mermaid
DiagrammeR::mermaid("
graph TD
Schleife1{i kleiner 10}
Schleife2{i kleiner 20}
Schleife1 --- Schleife2
")
:::
This is hard for us to fix in general because mermaid uses the size of the surrounding containers to determine its layout. A workaround is to render these initially-hidden diagrams to .png (although that means you won't get other features that come from the dynamic diagram compilation.)
I am experiencing a problem that is described well by the title of this issue. The following simple Quarto document contains no correctly rendered diagram:
---
title: "Test"
---
::: {.callout-note collapse="true"}
```{mermaid}
flowchart LR
id1
:::
![](https://github.com/user-attachments/assets/994201c1-b8d7-41e5-8790-fa5b6ae46ca2)
<details>
<summary><code>quarto check</code></summary>
Quarto 1.6.6
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.6
Path: /home/
[✓] Checking tools....................OK TinyTeX: (not installed) Chromium: (not installed)
[✓] Checking LaTeX....................OK Using: Installation From Path Path: /usr/local/texlive/2024/bin/x86_64-linux Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK Version: 3.12.4 Path: /usr/bin/python3 Jupyter: 5.7.1 Kernels: ir, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK Version: 4.4.1 Path: /usr/lib64/R LibPaths:
[✓] Checking Knitr engine render......OK
</details>
Bug description
Mermaid doesn't work inside a Callout Block when collapse=”true”. There might be two kinds of errors.
error 1: image cuts off as in #5145
error 2: Mermaid engine crashes with syntax error when labeling edges
Steps to reproduce
:::
labeling edges crashes Mermaid engine
:::{.callout-note collapse=”true”}}
Mermaid inside a Callout Block collapse is true
:::
:::
System 2