-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Status: TriageNeeds to be verified, categorized, etcNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrectSomething isn't working or is incorrect
Description
Description
Mermaid is unable to render SVGs from an external sprite. External SVGs with one icon per file works fine. But rendering fails when it's pointed to an external SVG sprite. Mermaid AI on the website said it should work, but it doesn't. So I submitted this issue after discussing it with Dominic and Akshatha.
Steps to reproduce
PFB an example diagram on the Mermaid website.
I'm sharing the sample code below.
Screenshots
As you can see, it fails to distinguish between the two items in the external sprite.

Code Sample
---
config:
theme: redux
---
flowchart TD
A(["Start"])
A --> B@{ img: "https://code.benco.io/icon-collection/azure-icons/Advisor.svg", label: "Decision", pos: "t", w: 60, h: 60, constraint: "off" }
B --> C@{ img: "https://cdn.jsdelivr.net/gh/Ayanmullick/test@master/Sprite1.svg#stackexchange-img", label: "Option A", pos: "t", w: 60, h: 60, constraint: "off" }
B --> D@{ img: "https://cdn.jsdelivr.net/gh/Ayanmullick/test@master/Sprite1.svg#stackoverflow-img", label: "Option B", pos: "t", w: 60, h: 60, constraint: "off" }
Setup
- Mermaid version: Current version.
- Browser and Version: [Chrome, Edge, Firefox]: Version 139.0.7258.67 (Official Build) (64-bit)
Suggested Solutions
These are two distinct SVG's that should render separately like below

Additional Context
This is the sample SVG sprite.
https://github.com/Ayanmullick/test/blob/master/Sprite1.svg?short_path=18ef591
PFB the example code of the SVG's rendering in an HTML.
Metadata
Metadata
Assignees
Labels
Status: TriageNeeds to be verified, categorized, etcNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrectSomething isn't working or is incorrect