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

Class diagram classifiers to not work with methods with special characters #3424

Closed
sambostock opened this issue Sep 6, 2022 · 1 comment
Labels
Type: Bug / Error Something isn't working or is incorrect

Comments

@sambostock
Copy link

sambostock commented Sep 6, 2022

Describe the bug

Many languages sometimes allow special characters in method names. For example, Ruby uses:

  • the ? suffix for "predicate methods"
  • the ! suffix for "dangerous methods"

These are not well supported, and in particular cannot be combined with static and abstract method classifiers.

To Reproduce

Define a method using special characters, such as ? or !.

Expected behavior

The method name should render like any other, with the correct formatting.

It is acceptable for it to be required to surround the method name with backticks, similarly to how :: support (Ruby's namespacing/nesting syntax) was added for class names by wrapping them in backticks.

Code Sample

CodeRenderedLive
classDiagram
  class `Example::Ruby::Class` {
    normal()
    predicate()?
    dangerous!()?
    static_normal()$
    static_predicate?()$
    static_dangerous!()$
  }
classDiagram
  class `Example::Ruby::Class` {
    normal()
    predicate()?
    dangerous!()?
    static_normal()$
    static_predicate?()$
    static_dangerous!()$
  }
Loading

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: Mermaid.live 9.1.6

Similar to #1635

@sambostock sambostock added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 6, 2022
@jgreywolf
Copy link
Contributor

Closing as duplicate of #1635

@jgreywolf jgreywolf added DUPE and removed Status: Triage Needs to be verified, categorized, etc labels Mar 10, 2023
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

No branches or pull requests

2 participants