Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(util.breakText): use the specified separator to join words, allow… #2360

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

kumilingus
Copy link
Contributor

… empty string to be separator; fix(dia.attributes): textWrap reads all breakText options

Description

When using a custom separator, the space character was always used to join words. This PR uses a separator on the input to join words as long as the separator was a string.

The separator can now be an empty string.

const text = joint.util.breakText('first*second', { width: 1000 }, {}, { separator: '*' });
// Assert: text === 'first*second'
// Prior to this PR the `first second` string has been returned

The PR also makes sure that textWrap cell attribute accepts the separator option.

element.attr('label/textWrap/separator', '*');

… empty string to be separator; fix(dia.attributes): textWrap reads all breakText options
@kumilingus kumilingus merged commit dc9dc6f into clientIO:master Oct 9, 2023
3 checks passed
@kumilingus kumilingus deleted the break-text-separator branch October 9, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants