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)
- Catalan (thanks to Jordi Rosell)
- Czech (thanks to Martin Hasoň)
- Danish (thanks to Henrik Ryom)
- Dutch (thanks to Remco Bloemen)
- English (US and GB)
- Esperanto (thanks to Sergio Pokrovskij)
- Estonian (thanks to Enn Saar and Peeter Marvet)
- Finnish (thanks to Olli Wilkman)
- Greek, monoton, polyton and ancient (thanks to Pablo Rodríguez)
- Hungarian (thanks to Péter Nagy)
- Italian (thanks to Stefano Gorini)
- Latin (thanks to Pablo Rodríguez)
- Latvian (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 (thanks to Erik Erik Seierstad)
- Polish (thanks to Kamil)
- Portuguese (thanks to Lailson Bandeira)
- Romanian (thanks to irragal)
- Russian (thanks to Dmitry Vedernikov)
- Serbian Latin script (thanks to Sonja Keljevic)
- Slovak (thanks to Zdenko Podobný)
- Slovenian (thanks to Mojca Miklavec)
- Spanish (thanks to Luis Pabón)
- 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.