- Code license
GNU Lesser GPL
- automatically hyphenates texts on websites if either the webdeveloper has included the script on the website or you use it as a bookmarklet on any site.
- automatically breaks URLs on any browser that supports the zero width space.
- runs on the client in order that the HTML source of the website may be served clean and svelte and that it can respond to text resizings by the user.
- has a documented API and is highly configurable to meet your needs.
- supports a wide range of languages.
- relies on Franklin M. Liangs hyphenation algorithm (PDF) commonly known from LaTeX and OpenOffice.
- is free software licensed under LGPL v3 with additional permission to distribute non-source (e.g., minimized or compacted) forms of that code (see source code header for details).
- provides services for customizing, merging and packing script and patterns.
- supports CSS3-hyphenation
Hyphenator.js does …
- not give you control over how many hyphens you'll have as endings on consecutive lines.
- not eliminate misleading hyphenation like 'leg-ends' (depending on the pattern quality).
- not work in Firefox 2 (but it works fine in Firefox >=3.0)
- not handle special (aka non-standard) hyphenation (e.g. omaatje->oma-tje)
See a simple life example (resize window or click the button in the upper right corner).
Where to go from here
See the articles in the wiki for more information about:
There's also a FAQ and a large set of test cases.
If you're looking for a server-side script doing hyphenation I recommend http://yellowgreen.de/phphyphenator
If you're looking for a script that does really nice line breaking (using an implementation of the Knuth and Plass line breaking algorithm) see http://www.bramstein.com/projects/typeset/flatland/.
There's a port of Hyphenator.js to ActionScript: http://code.google.com/p/hyphenator-flash/
If you're looking for a more light-weight solution (using Knuth's algorithm from 1977, english only), see http://github.com/aristus/sweet-justice
October 17, 2014
Version 4.3.0 is here! (Download from Google Drive)
This minor release brings the following changes:
- added support for Serbian Cyrillic (thanks to Milan Gurjanov)
- jsdoc3 formatted code comments in the source file
- the core functions are slightly faster (specially in chrome: removed some deopts)
- better performance when checking for CSS3 hyphens support
- new method for hyphenating URL-styled text (fixed issue188 and issue198 )
- prevention of a memory leak in some rare cases (fixed issue192 )
- Hyphenator. emits a warning to the console, when it is invoked twice (see documentation)
- Code refactoring for better readability
And some bugfixes:
- fixed an issue with Hyphenator.js running in private mode (fixed issue108 )
- fixed an issue with the Bookmarklet (fixed issue185 )
- fixed an issue with ommited tags (fixed issue194 )
- workaround for a bug in Konqueror 4.8.4 (fixed issue202 )
October 28, 2012
Created a huge compatibility table to see what browser supports what language for CSS3-hyphenation. Fun fact: with each visit a new test is run and added to the table.
Hyphenator.js is absolutely free of charge. But if you think Hyphenator.js is cool you can or