Text wrapping with soft hyphens (shy) or zero-width space

Hello,

I would like to display camel-case variable names in GoJS text blocks. I want to impose a fixed width to the text block, and have GoJS split the text on camel-case word boundaries. To do so, I tried to insert the dedicated Unicode characters in the text, but GoJS seems to only consider spaces for word wrap. How could I achieve this?

Here is the code I tried: I modified the TextBlock sample on wrapping. I included a drawing of the results I expect.

  diagram.add(
    $(go.Part, "Vertical",
      $(go.TextBlock, { text: "my Text Block", background: "lightgreen", margin: 2,
                        width: 50, wrap: go.TextBlock.WrapDesiredSize }),
      $(go.TextBlock, { text: "my\u200BText\u200BBlock", background: "lightgreen", margin: 2,
                        width: 50, wrap: go.TextBlock.WrapDesiredSize }),
      $(go.TextBlock, { text: "my\u00ADText\u00ADBlock", background: "lightgreen", margin: 2,
                        width: 50, wrap: go.TextBlock.WrapDesiredSize })
    ));

I see what you mean, we don’t treat those characters as whitespace and we probably should.

We’ll discuss this internally and release an update soon, probably next week.

Thanks for your quick reply!

This enhancement will be in version 1.7, next week.