Soft Hyphens in HTML

Soft hyphens have been thoroughly discussed for several years now by the HTML and Browser community.  See this long blog entry by Michael Kaplan on September 2nd, 2006 for interesting points of view, mainly about the displaying or non-displaying of these elusive "characters".

In this page, however, we concentrate on the "correct" functioning of these soft hyphens rather than whether they are real characters or not.

The numbers below should appear unbroken if you can display 150+ characters across your browser window.  However, if you reduce the browser window width, you should see breaks successively appearing at the 140, 130, 120 and finally the 10 character positions.  These are made possible by soft hyphens in the HTML, coded as ­ inserted at various points.  This is intended to eliminate the dreaded horizontal scrolling which we all hate.

• The 150-digit number:

• And inside a table:

  • 1111111111­2222222222­3333333333­4444444444­5555555555­6666666666­7777777777­8888888888­9999999999­0000000000­1111111111­2222222222­3333333333­4444444444­5555555555

Soft hyphens work in the Microsoft browsers Internet Explorer 6,7 or 8, Opera 10 and Safari 3.1 (525.13), but not inside tables in Firefox 3.5.3.  This last behaviour is very strange, since very long numbers with Soft Hyphens will typically be presented within Html tables.

Netscape 9.0.0.6 (final version Mar 2008), however, is schizophrenic.  It uses either Internet Explorer or Firefox as the Rendering Engine at the user's choice.  As Internet Explorer the soft hyphens work, but as Firefox they do not.

Some Linux browsers even make the soft hyphens visible (very ugly).  Konqueror and Mozilla both fail the test, but Opera for Linux actually works.

Copying and pasting in Safari has some strange side-effects.  Unless you double-click on the final piece of the hyphenated string, it only selects the string up to the piece containing the cursor.  An even worse effect is that it inserts spaces where the hyphens would be.