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

[Bug]: RegEx for breakText and textWrap opt.hyphen does not include international characters #2379

Closed
holzmare opened this issue Nov 2, 2023 · 1 comment · Fixed by #2385
Assignees
Labels

Comments

@holzmare
Copy link

holzmare commented Nov 2, 2023

What happened?

By default breakText and textWrap do not include chraracters from international alphabets leading to strange behaviour when wrapping words containing them. In my opinion the default should include those.

Suggested regex to match them:
/[^\w\dŽžÀ-ÿ]/

Version

3.7.5

What browsers are you seeing the problem on?

any browser

What operating system are you seeing the problem on?

any OS

@holzmare holzmare added the bug label Nov 2, 2023
@kumilingus
Copy link
Contributor

This might work better /[^\w\d\u00C0-\u1FFF\u2800-\uFFFD]/ (from StackOverflow answer).

The one you provided doesn't work for Czech ř, for example.

Note, this should not be a blocker as you can provide a custom hyphen to the textWrap attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants