jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
40.65k stars 7.57k forks source link

Special characters like "&" not working properly #3403

Closed nbelyh closed 1 year ago

nbelyh commented 1 year ago

Preflight Checklist

Describe the bug Text is broken when using underline with "special" characters like "&" (ampersand) See the video below.

To Reproduce Steps to reproduce the behavior:

  1. Drop a rectangle on the screen
  2. Uncheck "Formatted text" (this is important, when "formatted text" is on it works properly)
  3. Set rectangle text to "A&B"
  4. Click "Underline" button
  5. See error: "A&B" is changed to "A&B"

Expected behavior The text stays "A&B"

Screenshots image

draw.io version (In the Help->About menu of the draw.io editor):

Desktop (please complete the following information):

Smartphone (please complete the following information):

davidjgraph commented 1 year ago

This doesn't happen for me using 21.0.2 on any browser. Is this private/incognito with all extensions off?

nbelyh commented 1 year ago

@davidjgraph I just filmed it five minutes ago using the latest Chrome, and the current online version (diagrams.net website) Please make sure you turned OFF the "Formatted Text" checkbox, this is important (please follow the steps in the description)

nbelyh commented 1 year ago

@davidjgraph yes, reproducible also in private, with all extensions off. Actually, it is a very old bug. Just reporting some things we encountered in a while :)

alderg commented 1 year ago

Thanks for the report. This will be fixed in the next release.

nbelyh commented 1 year ago

@alderg sounds great! Could you give some details on how it was fixed (so that the fix can be reused in a fork like maxgraph for example?)

alderg commented 1 year ago

Line 9426 in Graph.js was changed as follows:

Screenshot 2023-03-06 at 18 44 51

davidjgraph commented 1 year ago

Fixed in 21.0.4