mermaid-js / zenuml-core

The ZenUML renderer

Home Page:https://embed.zenuml.com

Repository from Github https://github.commermaid-js/zenuml-coreRepository from Github https://github.commermaid-js/zenuml-core

There is a bit of a problem when rendering at src/demo1.js

danshuitaihejie opened this issue · comments

There is a bit of a problem when rendering line 15 ( "space in name"->"bg color".syncMethod(from, to) ):
image

Sample DSL code: src/demo1.js

// comments at the beginning should be ignored
title This is a title
@Lambda <<stereotype>> ParticipantName
group "B C" {@EC2 B @ECS C}
"bg color" #FF0000
@Starter("OptionalStarter")
new B
ReturnType ret = ParticipantName.methodA(a, b) {
  // Customised style for RESTFul API - \`POST /order\` <br>
  ReturnType ret2 = selfCall() {
    B.syncCallWithinSelfCall() {
      ParticipantName.rightToLeftCall()
      return B
    }
    **_"space in name"->"bg color".syncMethod(from, to)_**
  }
  // A comment for alt
  if (condition) {
    // A comment for creation
    ret = new CreatAndAssign()
    "ret:CreatAndAssign".method(create, and, assign)
    // A comment for async self
    B->B: Self Async
    // A comment for async message
    B->C: Async Message within fragment
    new Creation() {
      return from_creation
    }
    return "from if to original source"
    try {
      new AHasAVeryLongNameLongNameLongNameLongName() {
        new CreatWithinCreat()
        C.rightToLeftFromCreation() {
          B.FurtherRightToLeftFromCreation()
        }
      }
    } catch (Exception) {
      self {
        return C
      }
    } finally {
      C: async call from implied source  
    }
    =====divider can be anywhere=====
  } else if ("another condition") {
    par {
      B.method
      C.method
    }
  } else {
    // A comment for loop
    forEach(Z) {
      Z.method() {
        return Z
      }
    }
  }
}

A simplified code that can reproduce this issue is:

A B
B->A.method()
Screenshot 2023-08-28 at 10 14 26 pm