Repository navigation
Conversation
…oted titles The ARCH_TITLE terminal's unquoted alternative used the \w character class (ASCII-only without the u flag), so Chinese, Cyrillic, accented Latin characters and punctuation like - + , : / triggered lexer errors. It now accepts any character except square brackets and line breaks, so these titles parse correctly. Quoted titles and previously-valid labels are unchanged. Fixes mermaid-js#7961
🦋 Changeset detectedLatest commit: e848423 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 project configuration. |
📝 WalkthroughWalkthroughThe architecture parser now accepts unquoted bracket titles containing Unicode characters and punctuation while preserving quoted-title behavior. Tests verify service and group titles, and the changeset documents the updated parsing rule. ChangesArchitecture title parsing
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7984 +/- ##
===========================================
+ Coverage 77.46% 77.53% +0.06%
===========================================
Files 564 564
Lines 74906 74906
Branches 12661 12661
===========================================
+ Hits 58026 58076 +50
+ Misses 15881 15830 -51
- Partials 999 1000 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Hi @aloktomarr
What's working well 🎉 The grammar fix is correct and minimal — [\w ]+ → [^\[\]\r\n]+ is exactly the right change. Switching from an allow-list to a deny-list for brackets and line-breaks is the canonical way to 🎉 The test suite covers a great variety: Chinese (采集器), Cyrillic (Сервер), accented Latin (Café), and the specific punctuation characters reported in the issue (-, +, ,, :, /). Both service and 🎉 Changeset is correctly typed (patch on @mermaid-js/parser) with a clear description that names the root cause.
|
|
@aloktomarr, Thank you for the contribution! |
Description
architecture-betabracket titles only accepted[a-zA-Z0-9_ ], so Chinese,Cyrillic, accented Latin characters and common punctuation (
-,+,,,:,/)caused lexer errors. Other diagram types (e.g. flowchart) already handle Unicode.
Root cause
The
ARCH_TITLEterminal's unquoted alternative used\w, which without theuflag is ASCII-only. Fixed by accepting any character except square brackets and
line breaks (
[^\[\]\r\n]+). Quoted titles and previously-valid labels are unchanged.Tests
Added parser tests for non-ASCII (Chinese, Cyrillic, accented) and punctuated
titles for both
serviceandgroup. Full parser suite passes (293 tests).Fixes #7961
Summary
ARCH_TITLEparsing forarchitecture-betadiagrams to accept non-ASCII characters and punctuation in unquoted bracket titles.#7961.