Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
`text-overflow-wrap: whitespace | anywhere` #2119
See OP below:
Current (buggy) behaviour
Japanese, or other text without spaces, won't wrap even with 'text-wrap' or 'overflow-wrap' or 'word-break' set
Wrap after text-max-width even without spaces, or at least follow word-break CSS.
Minimum steps to reproduce
The docs aren't clear on this point, but word wrapping is only allowed on whitespace. If you have no whitespace, there is no opportunity for wrapping.
You can use manual newlines to indicate where wrapping should occur. Or you can provide possible break points with whitespace characters like
If you want to automatically break on non-whitespace characters (i.e. by a style property), that would require a new feature for some future non-patch release.
I suppose an implementation of
This is pretty much the best it can be with an
To have more control over where breaking happens, you'll have to use zero-width spaces as hints in your text at appropriate locations -- e.g. not before ")".