Is there an “invisible” hyphen in Unicode / HTML?

I found a very useful soft dechen (U + 00AD SHY), but I wonder if there is the same thing that tells the browser where to break long words for wrapping without adding any character at all?

For example, let's say you have a narrow column in HTML with the rationale for a newspaper, and the text has a clearly long URL. You can add a soft / shy hyphen, which I mentioned, but then when the user copies and pastes the URL, it will contain these hatching characters. An ideal situation would be the same visual results without a hyphen, so that the user can copy and paste a long word (s).

Thoughts or suggestions?

I tried looking for this, but most of what I came up with is non-expanding whitespace, and essentially I'm looking for the opposite.

The UPDATE . I found ZERO-WIDTH SPACE (U + 200B), but it still has a problem that the character is saved during copying and pasting into the address bar, so the results further confuse the end user.

+4
source share
1 answer

You need the HTML5 tag <wbr>that is specified in order to do exactly what you ask.

If you cannot rely on HTML5, the U + 200B ZERO WIDTH SPACE ( &#8203;) should also work.

( HTML-, , . <wbr> , , , WhatWG - , , Github .)

+2

Source: https://habr.com/ru/post/1660822/


All Articles