Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mermaid-Block not shown within Tabs #66

Closed
bh0fer opened this issue Sep 15, 2022 · 2 comments
Closed

Mermaid-Block not shown within Tabs #66

bh0fer opened this issue Sep 15, 2022 · 2 comments

Comments

@bh0fer
Copy link

bh0fer commented Sep 15, 2022

Describe the bug
When using mermaid diagrams inside tabs, only the initially shown tab renders the mermaid diagram, on the other tabs, the diagram is not shown. The result is the same for the compiled page and for the page running with the dev-server.

To Reproduce

Insert the following code to a mdx page in docusaurus (V2.1.0):

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="tab-a">

The following mermaid diagram is shown:

```mermaid
graph LR
  a ---> c(10)
  b ---> c(10)
```

</TabItem>

<TabItem value="tab-b">

This mermaid diagram is not displayed:

```mermaid
graph LR
  d ---> z(42)
  e ---> z(42)
```

</TabItem>
</Tabs>

Expected behavior

Mermaid diagrams are rendered correctly on each tab

Screenshots

mermaid-in-tabs

Tool chain used:

  • docusaurus v2.1.0
  • mermaid v9.1.6
  • mdx-mermaid v1.3.2
@bh0fer bh0fer changed the title Mermaid-Block not shown within Tab Mermaid-Block not shown within Tabs Sep 15, 2022
slorber added a commit to sjwall/docusaurus that referenced this issue Oct 14, 2022
@slorber
Copy link

slorber commented Oct 14, 2022

official docusaurus mermaid support is coming in facebook/docusaurus#7490

Your mermaid in tabs case should work, see https://deploy-preview-7490--docusaurus-2.netlify.app/tests/pages/diagrams#mermaid-in-tabs

@lebalz
Copy link

lebalz commented Oct 15, 2022

Cool 🥳 Thanks!

@sjwall sjwall closed this as completed Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants