Skip to content

Conversation

kriss-u
Copy link
Contributor

@kriss-u kriss-u commented Aug 4, 2025

📑 Summary

This PR adds classLiteralName on the class diagram's language. This allows backticks on namespace label which seems reasonable to do.

I have also added a test case to not throw if backticks used on the namespace for class diagrams.

Now, this is valid syntax.

classDiagram
    namespace `A::B` {
        class `IPC::Sender`
    }
    RenderProcessHost --|> `IPC::Sender`

Outputs to:

image

Resolves #6815

📏 Design Decisions

This is a straightforward change to add classLiteralName in the language definition of namespace.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented Aug 4, 2025

🦋 Changeset detected

Latest commit: c99bce6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
mermaid Patch
@mermaid-js/examples Patch

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

Copy link

netlify bot commented Aug 4, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit c99bce6
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/68923c484b1ee4000842dffe
😎 Deploy Preview https://deploy-preview-6820--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label Aug 4, 2025
Copy link

pkg-pr-new bot commented Aug 4, 2025

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/examples@6820

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@6820

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@6820

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@6820

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@6820

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@6820

commit: c99bce6

Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@4ab98c2). Learn more about missing BASE report.
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             develop   #6820   +/-   ##
=========================================
  Coverage           ?   3.71%           
=========================================
  Files              ?     454           
  Lines              ?   44752           
  Branches           ?     708           
=========================================
  Hits               ?    1661           
  Misses             ?   43091           
  Partials           ?       0           
Flag Coverage Δ
unit 3.71% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

argos-ci bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 added Aug 5, 2025, 5:25 PM

@shubhamparikh2704 shubhamparikh2704 self-requested a review August 5, 2025 07:29
@shubhamparikh2704
Copy link
Member

Hi @kriss-u , thansk for the contribution. PR looks great. Can you also add visual test for this.

@kriss-u kriss-u force-pushed the fix/6815_escape_namespace_class_diagram branch from cac4ae0 to c99bce6 Compare August 5, 2025 17:15
@kriss-u
Copy link
Contributor Author

kriss-u commented Aug 5, 2025

Hi @kriss-u , thansk for the contribution. PR looks great. Can you also add visual test for this.

Yeah. @shubhamparikh2704 I added one.

@shubhamparikh2704 shubhamparikh2704 added this pull request to the merge queue Aug 6, 2025
Merged via the queue into mermaid-js:develop with commit d93d9a5 Aug 6, 2025
22 checks passed
@kriss-u kriss-u deleted the fix/6815_escape_namespace_class_diagram branch August 8, 2025 21:10
This was referenced Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassDiagram namespaces do not support escaping
2 participants