@readme/markdown 7.7.2 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,7 +86,7 @@
86
86
 
87
87
  pre.mermaid {
88
88
  &_single {
89
- background: var(--color-bg-page, white);
89
+ background: none;
90
90
  }
91
91
  }
92
92
 
@@ -5,20 +5,21 @@ import React, { useEffect } from 'react';
5
5
 
6
6
  let mermaid: Mermaid;
7
7
 
8
- if (typeof window !== 'undefined') {
9
- import('mermaid').then(module => {
10
- mermaid = module.default;
11
- });
12
- }
13
8
 
14
9
  const CodeTabs = props => {
15
10
  const { children, theme } = props;
16
11
 
17
- // set Mermaid theme
12
+ // render Mermaid diagram
18
13
  useEffect(() => {
19
- mermaid?.initialize({
20
- theme: theme === 'dark' ? 'dark' : 'default',
21
- });
14
+ if (typeof window !== 'undefined') {
15
+ import('mermaid').then(module => {
16
+ mermaid = module.default;
17
+ mermaid.initialize({
18
+ theme: theme === 'dark' ? 'dark' : 'default',
19
+ });
20
+ mermaid.contentLoaded();
21
+ });
22
+ }
22
23
  }, [theme]);
23
24
 
24
25
  function handleClick({ target }, index: number) {