Hyphenator.js is a free open source Javascript library that automatically hyphenates text on websites. It comes in handy as a polyfill for legacy browsers that don't support CSS 3 hyphation at all or for modern browsers that do hyphenation, but do not provide hyphenation dictionaries for a particular language.
Hyphenator.js …
hyphenate
-classes, set lang
and add Hyphenator.js)As with most things, there's a downside, too. Consider the following drawbacks before using Hyphenator.js:
This beauty becomes manifest in content and representation. I'm firmly convinced that all written text (well, most of it) deserves fine typography, that we deserve it. While hyphenation is just one of many tesserae that forms the appearance of text, it may be an important one.
In code there is readability, maintainability, performance and genius – and some constraints of technology. As a hobbyist programmer I often feel like a hobbit surrounded by wizards who campaign for these values. But being an agile hobbit gives me the freedom to find my own way through the woods (thankfully free from evil in this area). I'm constantly in search of the most performant path to circumvent the constraints of technology while maintaining readability and maintainability of my code. Sometimes this path is illuminated by a wizard1.
Each release is tested in various browsers with an automated testsuite. Nevertheless, there will always be bugs. Please don't hesitate to submit them.
If you have a special use case and Hyphenator.js doesn't provide a solution, feel free to submit a feature request.
And please, be patient. Hyphenator.js is a hobby of mine and sometimes other things have precedence…
(1) Some of my coding wizards are: