Automatically hyphenates text
This is a jQuery plugin integrating Hyphenator.js
by Mathias Nater.
- automatically hyphenates texts on websites
- 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).
Supported languages are:
- Armenian (thanks to Sahak Petrosyan)
- Belarusian (thanks to Olexandr Zhydenko)
- Czech (thanks to Martin Hasoň)
- Danish (thanks to Henrik Ryom)
- Dutch (thanks to Remco Bloemen)
- Finnish (thanks to Olli Wilkman)
- Greek, monoton, polyton and ancient (thanks to Pablo Rodr\xEDguez)
- Hungarian (thanks to P\xE9ter Nagy)
- Italian (thanks to Stefano Gorini)
- Latin (thanks to Pablo Rodr\xEDguez)
- Latvian (coming soon, thanks to Kristaps Karlsons)
- Lithuanian (thanks to Rogutės Sparnuotos)
- Malayalam, Tamil, Hindi, Oriya, Kannda, Telugu, Bengali, Gujarati and Panjabi (thanks to Santhosh Thottingal)
- Norwegian (coming soon, thanks to Erik Erik Seierstad)
- Polish (thanks to Kamil)
- Portuguese (thanks to Lailson Bandeira)
- Russian (thanks to Dmitry Vedernikov)
- Slovakian (thanks to Zdenko Podobny)
- Slovenian (thanks to Mojca Miklavec)
- Spanish (thanks to Luis Pab\xF3n)
- Swedish (thanks to Andreas Johansson)
- Turkish (thanks to Andreas Lappe)
- Ukrainian (thanks to Alexey Grekov)
A custom jQuery adapter makes sure text loaded asynchronously is processed later on.
The default language is derived reading the language information of the html page as generated by your foswiki language settings.
Further more, specific parts of a page can be processed using different langugage patterns using an iso-639-1 language tag, e.g.
This part is processed using the british hyphenation patterns.
For further information see http://code.google.com/p/hyphenator/
To load the hyphenator into the current page use
Then add the
class name to those html elements that contain text to be hyphenated.
to exclude areas from being processed. The language used for processing the
text is extracted from the html language settings.
<div class="hyphenate" style="text-align:justify">
This text is processed by Hyphenator.js
This text is _excluded_ from hyphenation
This text is _not_ processed.
This text is processed as well.
<div class="hyphenate" lang="de">
Dieser Text wird mit deutscher Silbentrennung verarbeitet.
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions
for more help.