### Bug description

Mermaid diagrams in reveal JS clip the diagram image after the second slide. 

For example, consider the following file (named slides.qmd):

````
---
title: "mermaid crash"
format:
    revealjs
---


# git graph 1

```{mermaid}
gitGraph
   commit id: "Alpha"

```

# git graph 2

```{mermaid}
gitGraph
   commit id: "Alpha"

```

# git graph 3

```{mermaid}
gitGraph
   commit id: "Alpha"

```

````

Creates the expected output for git graph 1 and 2, which look like this:

![image](https://user-images.githubusercontent.com/11671536/192181269-e8133515-b41d-4802-b752-8f801ed65bb0.png)

But slide 3 looks like this (as do any subsequent slides with mermaid content):

![image](https://user-images.githubusercontent.com/11671536/192181354-ee0894ab-c17e-48a2-9591-053d0f548ad0.png)

I am using the latest nightly build (1.2.157) on Ubuntu 20.04.  I am just using quarto from the command line to generate the html (no R studio). 

I get the same problem when viewer rendered html with Chrome or Firefox.  Also, it is not unique to gitGraph, any mermaid content gets distorted and clipped. Interestingly, sometime while in preview mode the problem rights itself after making a change  to any of the slides (but not always).

Thanks!






### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
jjallaire
2022-09-26T02:29:48Z
d-chambers
bug mermaid
v1.2
closed
Mermaid diagrams in reveal JS don't render after 2nd slide
https://github.com/quarto-dev/quarto-cli/issues/2607