Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Allow astro-diagram to set id for call to mermaidAPI.render #82

Description

@voidmain

Currently, it looks like the code that generates the Mermaid diagram is not passing in anything for the id parameter. This causes Mermaid to use the default id of diagram. This will conflict with other elements on the page that have the same id.

You could allow a new property on the Diagram element that allows the id to be specified like this:

<Diagram id="foo" code={code} config={config}/>

The code change would be in the file https://github.com/JulianCataldo/web-garden/blob/develop/components/Diagram/Diagram.astro on line 24:

id: props.id

You'll need to handle the safeguards as well. I'm happy to submit a PR if you prefer. 😁

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