Skip to content

Commit

Permalink
Try a different .present slide selector
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jul 11, 2024
1 parent d55a50b commit 26a749d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
34 changes: 32 additions & 2 deletions demo-mermaid/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mermaid:
lineColor: '#fff'
---

Foo
Slide A-1

```mermaid
graph TD
Expand All @@ -19,7 +19,37 @@ const x = 1;

---

Bar
Slide B-1

```mermaid
graph TD
A[Client] --> B[LB]
B --> C[Server01]
B --> D[Server02]
```

```js
const x = 2;
```

----

Slide B-2

```mermaid
graph TD
A[Client] --> B[LB]
B --> C[Server01]
B --> D[Server02]
```

```js
const x = 2;
```

---

Slide C-1

```mermaid
graph TD
Expand Down
5 changes: 4 additions & 1 deletion lib/template/reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@
const mermaidOptions = extend({ startOnLoad: false }, {{{mermaidOptionsStr}}});
mermaid.startOnLoad = false;
mermaid.initialize(mermaidOptions);
const cb = function (event) { mermaid.init(mermaidOptions, '.stack.present>.present pre code.mermaid'); };
const cb = function (event) {
mermaid.init(mermaidOptions, '.stack.present > .present pre code.mermaid');
mermaid.init(mermaidOptions, '.slides > .present:not(.stack) pre code.mermaid');
}
Reveal.addEventListener('ready', cb);
Reveal.addEventListener('slidetransitionend', cb);
</script>
Expand Down

0 comments on commit 26a749d

Please sign in to comment.