JSM’s Non-Breaking Space for French Content


  • Plugin Name: JSM's Non-Breaking Space for French Content
  • Stable Version: 1.8.1-1
  • Author: JS Morisset
  • Description: Adds a non-breaking space between words and punctuation marks to avoid inappropriate line-breaks in French.
  • License: GPLv3
  • Requires At Least: WordPress 3.8
  • Tested Up To: WordPress 4.7.2
  • Last Updated: 9 hours ago
  • Downloaded: 1,555 times
  • Plugin Homepage »

This plugin adds non-breaking spaces required by the French language in the content, excerpt, comments, and text widget — skipping over pre-formatted code blocks, styles and scripts.

If the <!--:fr--> HTML tag is found (used by some multilingual plugins), non-breaking spaces are added only between the <!--:fr--> and <!--:--> HTML tags.

There are no plugin settings — simply install and activate the plugin.

Filters for Developers

'nbsp_french_add_filters' ( array $names ) — An associative array of filter names (and their priority number) to hook by default.

'nbsp_french_currencies' ( $pcre ) — A list of recognized currencies.

'nbsp_french_preg_first_second_last' ( array $pattern ) — An array of patterns to match. Spaces are replaced in the second set of parenthesis, and the returned string corresponds to the first, second, and last set of parenthesis.

To hook additional filters, include their names and priority in the 'nbsp_french_add_filters' array, or hook them individually in your functions.php file: