Skip to content

mermaid rendering bug in MkDocs content tabs #117

@onford

Description

@onford

I just find a problem when rendering mermaid figures in MkDocs content tabs. When using !!python/name:mermaid2.fence_mermaid format for custom_fences, and try to put mermaid figures into different content tabs, the figures would have rendering bugs from the 2nd content tab.

For example, write these content into a markdown file:

=== "block1"
    ```mermaid
    graph TD
        A --> B
    ```
    ```mermaid
    graph TD
        A --> B
    ```
=== "block2"
    ```mermaid
    graph TD
        A --> B
    ```
    ```mermaid
    graph TD
        A --> B
    ```
=== "block3"
    ```mermaid
    graph TD
        A --> B
    ```
    ```mermaid
    graph TD
        A --> B
    ```

This put a figure twice into the 3 content tabs respectivly, and this is the rendering result:

Image

Image

Image

However, if I change the format of custom_fences to !!python/name:mermaid2.fence_mermaid_custom, or I simply give up using content tabs, this mermaid rendering would become normal. How could I solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions