Skip to content

Add hyphenation-hint as HTML-element #6326

@OskarGrosser

Description

@OskarGrosser

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:

  • Inside an inline-element (even with display: contents)
  • Inside a pseudo-element

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:

  • Display as a hyphen, if at a break-point
  • Be respected by hyphens: manual
  • Be itself unselectable; it is only for visual guidance
  • Take up space when displayed
  • Inherit the currently used font

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsi18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.topic: rendering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions