This is a test page for Java­script soft-hy­phen­ation

This page may only work in Moz­ill­oids. Try res­iz­ing the page - noth­ing will happen until you stop dragg­ing, and then the hy­phen­ation will be re­flowed.

This page uses a bit of Java­script that I wrote to fix the fact that Moz­illa does­n't han­dle the ­ en­tity prop­erly. At pre­sent, Moz­illa never crea­tes vis­ible hy­phen­ation for that en­tity - ins­tead, it treats the en­tity as if it does­n't ex­ist.

This bit of Java­script finds the soft-hyphen char­ac­ters in the page, does a little trans­form­ation work on them, and re­calc­ulates the hy­phen­ation every time the page is re­drawn. Frankly, it's a nasty hack that shoul­dn't need to be writ­ten, and its usage is best avoi­ded. How­ever, if you find that you need to use it, it's easy: just include shy.js in your page, add the window.onload and window.onresize triggers (see the source of this page) and any ­ char­act­ers that you use will magi­cally work as int­end­ed.

Let's see what happens with tables, column-width of 50 pixels:

no hyphenation no hyphenation
hyphen­ation hyphen­ation

(It appears to work in IE/Win too, but that's because IE is doing the right thing from the start, without needing any extra JS bollocks)

For more information about this hack, please see this blog entry.

Yoz Grahame, 2005-01-17