Open
Description
I want to prevent a line break after a hyphen that is preceded by a space.
So a string like
foo bar -baz
can be broken as
foo bar
-baz
but not
foo bar -
baz
I’m not sure if this can be solved by CSS spec (e.g., a new keyword for hyphens
or overflow-wrap
, etc.) or if it’s a browser bug: Firefox does like described by default, Chrome doesn’t.
(Demo: https://codepen.io/valtlai/pen/WLRjeo/left/?editors=1100)
Another example
String:
foo -webkit-baz
Allowed:
foo -webkit-
baz
Disallowed:
foo -
webkit-baz