Skip to content
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

Allow architecture diagrams to support any character for titles #5929

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

wizbit
Copy link

@wizbit wizbit commented Oct 4, 2024

📑 Summary

Allows any character between [ and ] for architecture diagram titles.

Resolves #5928

📏 Design Decisions

Change of regex to allow any character. Also had to tweak the entry Architecture rule as tests were claiming ambiguity.

📋 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 Oct 4, 2024

⚠️ No Changeset found

Latest commit: 67d928f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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

netlify bot commented Oct 4, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 67d928f
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/673b048ef7b09c0008224903
😎 Deploy Preview https://deploy-preview-5929--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 site configuration.

Copy link

pkg-pr-new bot commented Oct 4, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5929
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5929

commit: 67d928f

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Project coverage is 4.49%. Comparing base (8328f74) to head (67d928f).

Files with missing lines Patch % Lines
packages/parser/tests/test-util.ts 0.00% 14 Missing ⚠️
...parser/src/language/architecture/valueConverter.ts 0.00% 12 Missing ⚠️
...mermaid/src/rendering-util/handle-markdown-text.ts 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5929      +/-   ##
==========================================
- Coverage     4.49%   4.49%   -0.01%     
==========================================
  Files          382     383       +1     
  Lines        53914   53952      +38     
  Branches       621     596      -25     
==========================================
  Hits          2425    2425              
- Misses       51489   51527      +38     
Flag Coverage Δ
unit 4.49% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...mermaid/src/rendering-util/handle-markdown-text.ts 0.00% <0.00%> (ø)
...parser/src/language/architecture/valueConverter.ts 0.00% <0.00%> (ø)
packages/parser/tests/test-util.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@wizbit wizbit force-pushed the bug/5928_architecture-diagram-allow-all-character-for-title branch from 66f4f73 to 7857686 Compare October 4, 2024 09:04
Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing all characters seems okay at the first glance. Love the unit tests!
We should unify the string handling approach, and support markdown as well. (We already support it in flowcharts and some others, so the same functions should be used).


We should also make the grammar stricter to disallow architecture-beta and group in the same line. As the grammar is in beta, we can make breaking changes.


After this is finalized, we also need E2E tests and documentation updates, which show the capabilities in examples.

packages/parser/tests/architecture.test.ts Outdated Show resolved Hide resolved
Copy link

argos-ci bot commented Oct 4, 2024

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

Waiting for the first build to start…

@NicolasNewman
Copy link
Collaborator

NicolasNewman commented Oct 5, 2024

Good catch on the ambiguous grammar! If markdown support is planned to be added we may also want to consider KaTeX support. Other then the above request changes everything looks good to me.

@wizbit
Copy link
Author

wizbit commented Oct 6, 2024

Added markdown support. It already had the ability to render, so added grammar rules for ["`...`"]and ["..."].
KaTeX support is tricker. I've added it to the demos but it does not render correctly. Turning on htmlLabels for rendering makes it work but breaks everything else, so not sure how to proceed with KaTeX.

@wizbit wizbit force-pushed the bug/5928_architecture-diagram-allow-all-character-for-title branch from 3b2066b to ee87aca Compare November 18, 2024 08:48
@wizbit wizbit requested a review from sidharthv96 November 18, 2024 08:49
@wizbit wizbit force-pushed the bug/5928_architecture-diagram-allow-all-character-for-title branch from ee87aca to 67d928f Compare November 18, 2024 09:10
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.

Architecture diagram does not support non-alphanumeric characters in titles
4 participants