Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module automatically applies language-specific typography rules to your content using client-side JavaScript. It ensures correct spacing around punctuation and units without altering your database content, making it clean and portable. The module supports multiple languages with configurable rules and selectors, automatically processing content loaded after the initial page render.

The Non-Breaking Space Title module automatically applies language-specific typography rules to your content using client-side JavaScript. It ensures proper spacing around punctuation marks, quotes, and units without modifying your database content, keeping your data clean and portable across different contexts (APIs, exports, search).

Features

  • Multi-language support: Configure different typography rules for each active language on your site
  • Client-side processing: Rules are applied via JavaScript, keeping your database content clean and portable
  • Configurable selectors: Choose which CSS selectors to target (titles, headings, content areas, etc.)
  • Per-language rules: Define regex patterns and replacements tailored to each language's typography conventions
  • Pre-configured rules: Includes default rules for English (em dashes) and French (non-breaking spaces before punctuation, French quotes, units)
  • Dynamic content support: Uses MutationObserver to automatically process content loaded after page load
  • Permission-based access: Dedicated permission for managing typography rules

Use cases:

  • Multi-language sites requiring different typography rules per language
  • Publications that need to maintain clean, portable content in the database
  • Sites that want to enforce typography standards without manual editing

Post-Installation

  1. Enable the module: Install and enable via Drush (drush en nbsp_title) or the Extend page
  2. Clear cache: Run drush cr to register the new permission
  3. Set permissions: Go to /admin/people/permissions and assign the "Administer Non breaking space title" permission to appropriate roles
  4. Configure rules: Navigate to Configuration → User interface → Non breaking space title (/admin/config/regional/nbsp-title)
  5. Configure selectors: Add CSS selectors (one per line) for elements where rules should apply. Default selectors include .node__title, .page-title, h1, h2, h3h4
  6. Add language rules: For each active language, add typography rules with:
    • Description: Explanation of what the rule does
    • Pattern: JavaScript regular expression (e.g., \s+([:\;!\?]))
    • Replacement: Replacement string (e.g.,  $1 - will be converted to Unicode non-breaking space)

The module automatically applies rules based on the current language context

Additional Requirements

  • Drupal: Core 10, or 11
  • No additional libraries required: Uses vanilla JavaScript and Drupal core APIs

This module works standalone but complements:

  • Language modules: Works seamlessly with Drupal's core language and translation systems
  • Content translation: Automatically applies appropriate rules based on content language

Supporting this Module

This module is maintained as part of ongoing Drupal development work. Contributions, bug reports, and feature requests are welcome on the project issue queue.

Community Documentation

  • Issue queue: Report bugs and request features on Drupal.org
  • Examples: See the module's configuration page for pre-configured typography rules for French and English

Activity

Total releases
1
First release
Feb 2026
Latest release
4 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Feb 27, 2026