Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Typography Filter

Security covered Under active development 24 sites

This module automatically improves the typography of your content using the JoliTypo PHP library. You can enable it as a text filter within your text formats to apply these improvements directly to your content.

Overview

Text filter to automatically improve typography of your content. It relies on the JoliTypo PHP library.

How to use

As a filter in editor

  1. Go to your text filters configuration page (admin/config/content/formats);
  2. Edit or create a filter, check the "Improve typography" filter;
  3. Enable necessary filter types and save the configuration.

As a service

To process HTML content:

// Parameters: only $content is required, other parameters have default values.
$content = '<div>Some <p>text</p></div>';
$rules = ['CurlyQuote', 'Dash'];
$locale = 'en';
$protected_tags = '<p>';
// Process.
$result = \Drupal::service('typography_filter.manager')->fix($content, $rules, $locale, $protected_tags);

To process non-HTML content:

// Parameters: only $content is required, $rules parameter has default value.
$content = 'Some text';
$rules = ['CurlyQuote', 'Dash'];
// Process.
$result = \Drupal::service('typography_filter.manager')->fixString($content, $rules);
Drupal 10–11 PHP >=8.1

Ask your assistant about Typography Filter

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Jan 2023
Latest release
1 month ago
Releases (12 mo)
1 ▼ from 3
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.1 Stable 10–11 PHP >=8.1 Sep 11, 2026
2.0.0 Stable 10–11 Oct 5, 2025
2.0.0-rc1 Pre-release 8–11 Jan 11, 2025
2.0.x-dev Dev 10–11 Nov 6, 2024
8.x-1.1 Stable 8–11 Sep 23, 2024
8.x-1.0 Stable 8–10 Jan 20, 2023