TIP HyphenatorContrib is not installed on Foswiki.org.


Automatically hyphenates text

This is a jQuery plugin integrating Hyphenator.js by Mathias Nater.

Hyphenator.js ...

  • automatically hyphenates texts on websites
  • runs on any modern browser that supports JavaScript and the soft hyphen (­).
  • 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.
  • follows the ideas of unobtrusive JavaScript.
  • 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)
  • French
  • German
  • 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.

<div lang="en-gb">
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 .hyphenate class name to those html elements that contain text to be hyphenated. Use .donthyphenate 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

  <div class="donthyphenate">
    This text is _excluded_ from hyphenation


This text is _not_ processed.

<div class="hyphenate">
This text is processed as well.

<div class="hyphenate" lang="de">
Dieser Text wird mit deutscher Silbentrennung verarbeitet.

Installation Instructions

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 configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.



Change History

02 Sep 2016: (4.00) updated to hyphenate 5.1.0
28 Aug 2014: (3.02) use https by default talking to google
15 Mar 2014: (3.01) fixed syntax error in contrib stub
07 Nov 2013: (3.00) upgraded to Hyphenator-4.2.0
09 Aug 2011: (2.00) upgraded to Hyphenator-4.0.0
10 Jun 2011: (1.01) recognize language tags using underscores as well as hyphens
06 Jun 2011: (1.0) initial release of foswiki plugin
Topic revision: r8 - 02 Sep 2016, MichaelDaum - This page was cached on 26 Oct 2016 - 04:08.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License