-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bug/#3251_linkStyle-can't-specify-ids Fixed #4934
bug/#3251_linkStyle-can't-specify-ids Fixed #4934
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #4934 +/- ##
===========================================
- Coverage 79.97% 79.97% -0.01%
===========================================
Files 164 164
Lines 13623 13625 +2
Branches 693 693
===========================================
+ Hits 10895 10896 +1
- Misses 2579 2580 +1
Partials 149 149
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hi @Yash-Singh1 , Could you please check my approach to fix this bug. Pardon for mistakes if any . Grateful for Your Suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left a few comments down below.
packages/mermaid/src/diagrams/flowchart/parser/flow-style.spec.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Love the tests, just needs some minor fixes :)
packages/mermaid/src/diagrams/flowchart/parser/flow-style.spec.js
Outdated
Show resolved
Hide resolved
0c0f7a7
@RounakJoshi09, Thank you for the contribution! |
📑 Summary
In my fix, I've added a condition to handle the case where the index provided in linkStyle is greater than or equal to the length of the edges array. This provides a clear error message to the user and prevents a TypeError from occurring.
Resolves #3251
📏 Design Decisions
The implementation ensures that if the user attempts to apply a style to an index that exceeds the number of available edges, an error message will be displayed.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch