-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
feat: support multiple stereotypes in class diagrams #7098
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
base: develop
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7098 +/- ##
=======================================
Coverage 3.55% 3.55%
=======================================
Files 473 473
Lines 47480 47480
Branches 730 730
=======================================
Hits 1687 1687
Misses 45793 45793
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
sidharthv96
left a comment
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.
Can you please add some unit tests (+ve and -ve) as well?
Also need to fix lint and build issues.
Defer syntax changes to @knsv, need to double check the ignoring of space.
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.
| > | ||
| > ```mermaid-example | ||
| > classDiagram | ||
| > class Shape <<interface>> | ||
| > ``` | ||
| > ```mermaid-example | ||
| > classDiagram | ||
| > class Shape <<interface>> <<injected>> | ||
| > ``` | ||
| > |
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.
Formatting of new docs is off, I think it needs a space before each line, after the >
| > Both methods are fully supported and produce identical diagrams. | ||
| > However, it is recommended to use the **inline style** for better readability and consistent formatting across diagrams. | ||
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.
Are we sure we need to remove the recommendation?

📑 Summary
Implements support for multiple stereotypes/annotations in class diagrams using three syntax variations:
Syntax:
Changes:
Extended JISON grammar to support multiple consecutive annotations via recursive annotationList rule
Added class-body-annotation lexer state to handle annotation parsing without breaking member tokenization
Updated rendering to display each stereotype on a separate line with guillemets
Added whitespace skipping between annotations in class body
Testing:
Added class-multiple-stereotypes.html with 7 test cases
Updated existing Cypress tests to handle new annotation rendering
Resolves #6680
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.