mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.4k stars 227 forks source link

feat: add svgId option #645

Closed ouuan closed 7 months ago

ouuan commented 7 months ago

:bookmark_tabs: Summary

Add a new option -I, --svgId [svgId] to set the id attribute of the <svg> element to be rendered.

This is useful when the output is used as a part of HTML, because Mermaid CSS pollutes the global CSS with the id.

:straight_ruler: Design Decisions

svgId || 'my-svg' to use the old id as default. || instead of ?? to avoid empty id and for better compatibility.

:clipboard: Tasks

Make sure you

MindaugasLaganeckas commented 7 months ago

@aloisklink you are welcome to merge it!