mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.75k stars 6.08k forks source link

Class diagram: static abstract method does not work #5459

Open TeaDrinkingProgrammer opened 2 months ago

TeaDrinkingProgrammer commented 2 months ago

Description

When I want to define a static abstract method, it does not work.

Steps to reproduce

See code block and screenshot.

Screenshots

mermaid-diagram-2024-04-12-115822

Code Sample

classDiagram
    class Animal {
        +MakeNoise(TEntity domainEntity) string$*
    }

Setup

Suggested Solutions

No response

Additional Context

No response

TeaDrinkingProgrammer commented 2 months ago

I am quite sure I have found the bug in the sourcecode. This:

    switch (this.classifier) {
      case '*':
        return 'font-style:italic;';
      case '$':
        return 'text-decoration:underline;';
      default:
        return '';
    }

Should be this (approximately, I don't know if the syntax is exactly right):

    switch (this.classifier) {
      case '*':
        return 'font-style:italic;';
      case '$':
        return 'text-decoration:underline;';
      case '$*' || '*$':
        return 'font-style:italic;text-decoration:underline;'
      default:
        return '';
    }

I'll test further this weekend and submit a PR.