Do you need to preserve spacing between words when using the textWrap attribute? Adding the preserveSpaces attribute can help you maintain the specific spacing required when working with text subelements.
Resize the elements, and notice the difference in how spacing is affected with the textWrap attribute. The second element is utilising the preserveSpaces attribute.
The source code of this demo is available as part of the JointJS+ commercial license. Don't have a license yet? Start a trial and use the source code of this and many other demos for free, with no obligations, for 30 days.