clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs

Home Page:https://jointjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Unexpected character '0' is added to broken text by util.breakText function.

DavidSama1993 opened this issue · comments

What happened?

Input

code screenshot

Output

resultScreenshot

I have tried to debug the problem and my solution is bellow.
solution

Version

3.6.2

What browsers are you seeing the problem on?

Chrome

What operating system are you seeing the problem on?

Windows

  • Does the issue exist in the latest version 3.7?
  • Could you please paste here the input text?
  • Why is there a text attribute on the <text> element in your screenshot? JointJS does not add the text attribute when rendering text.
  • I didn't try it in the lastest version, but I have viewed the source code in v3.7.4 and found that there is no difference at the position I marked. So I guess the problem remains.
  • The input text could be 'aaaaaaaaaaaaaa/ddddd\n金木水火土' and the '\n' is a linefeed.
  • I'm so sorry that I don't know why there is a text attribute on the <text> element. I just set the attrs according to the method demonstrated in the official document like this. The unexpected charactor '0' is occasional when I resize the element.
    image

Ok, no worries. Thanks for reporting this. It's indeed a bug. I was able to reproduce it with this string aaaaaaaaaaaaaa/ddddd\nc too. We'll look into this soon.