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

Better class name literals #1907

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Better class name literals #1907

merged 1 commit into from
Mar 11, 2021

Conversation

TreyE
Copy link
Contributor

@TreyE TreyE commented Feb 25, 2021

📑 Summary

Add the ability to have literal class names.

This helps with, but does not fully resolve:

I have also reduced the number of shift/reduce conflicts in the parser without breaking any test cases. In order to avoid introducing more conflicts in the future I have also added a test that counts the number of conflicts. It won't remove all the existing conflicts from the mainline branch, but it will make sure new ones are not introduced without being detected.

📏 Design Decisions

We've frequently discovered while using mermaid issues with the allowed class names. We work in Ruby, so not being able to have a double colon ("::") in our class names is a big blocker to switching to mermaid. This PR allows class name literals to be enclosed in backticks, so literal class names may be used even if they contain special characters.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added unit/e2e tests (if appropriate)
  • 🔖 targeted develop branch

@knsv knsv requested a review from jgreywolf February 27, 2021 09:31
@@ -214,10 +219,12 @@ statements
;

className
: alphaNumToken { $$=$1; }
:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the empty line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OMG - bad typing is why. Let me fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be addressed in latest push.

@TreyE TreyE requested a review from jgreywolf March 6, 2021 14:57
@jgreywolf jgreywolf merged commit 407996b into mermaid-js:develop Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants