-
-
Notifications
You must be signed in to change notification settings - Fork 8k
fix(sequenceDiagram): allow empty message after colon (Fixes #6518) #6523
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
fix(sequenceDiagram): allow empty message after colon (Fixes #6518) #6523
Conversation
🦋 Changeset detectedLatest commit: b821454 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6523 +/- ##
==========================================
- Coverage 3.87% 3.87% -0.01%
==========================================
Files 412 413 +1
Lines 43164 43175 +11
Branches 665 665
==========================================
Hits 1672 1672
- Misses 41492 41503 +11
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 ↗︎
|
Thanks for this fix! I have a few minor improvement suggestions: Simplification: Since the updated regex already allows zero or more characters after :, the fallback rule Could we check if removing it would still pass all tests? Might help keep the lexer a bit cleaner. Extra Test Suggestion: Maybe add a test for input like Versioning: This is marked as a major bump that makes sense if we assume downstream users might depend on the stricter old behavior. (Just confirming if that was fully intended.) Overall great work this makes sequence diagrams much more user-friendly! |
Thanks @NourBenz. Good update! I appreciate that you added the unit test as well. |
@NourBenz, Thank you for the contribution! |
📑 Summary
This pull request fixes an issue where sequence diagram arrows with a trailing colon but no message (e.g.,
B ->> A:
) would fail to parse. The grammar previously required at least one character after the colon, which was unnecessarily restrictive.Resolves #6518
📏 Design Decisions
The lexer rule for
TXT
was too strict, requiring one or more characters after the colon. This PR modifies the rule to allow zero or more characters (*
instead of+
), and adds a fallback pattern to match a standalone colon.🔧 Lexer Fix
This enables syntax such as:
which now parses correctly.
No changes were needed in the parser or rendering logic since TXT is already processed safely as an optional message.
📋 Tasks
Make sure you