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

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

Open
voidmain opened this issue Apr 26, 2023 · 0 comments
Open

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

voidmain opened this issue Apr 26, 2023 · 0 comments

Comments

@voidmain
Copy link

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. 😁

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

1 participant