Add hyphenation-hint as HTML-element · Issue #6326 · whatwg/html (original) (raw)

Currently there is ­ to hint to a possible line-break opportunity. But as ­ is its own character, copying the underlying text will copy that character as well.

When ­ is inside an element, it will not display a hyphen, even if it is at a line-break.
"Inside an element" includes:

This rules out the possibility of styling it to behave only as a line-break opportunity, without copying it.

Changing the behavior of ­ is out of question, as it is already used for long and for specific purposes. Also, its definition is debated, but HTML and Unicode seem to have settled on one.
Hence there is still a need for hinting to line-break opportunities without the hint actually encoding a character. Without the ability of styling ­ to mimic said behavior, another solution is required.

There exists a similar case, where U+200B ZERO-WIDTH SPACE can be represented by <wbr> or &#x200B;, with the first being unselectable, and the latter as the character itself.

I suggest - as in the zero-width space case - to have a complementary HTML-element for &shy;.
It should:

Basically be &shy; but unselectable, as in not part of the rendered text, like <wbr>.