Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Improve Line Breaks Filter

Security covered Under active development 2,122 sites

This module provides a text filter that replaces empty paragraphs with line break tags, improving website appearance by preventing unwanted spacing. It also offers an option to completely remove empty paragraphs, while intelligently skipping certain HTML tags.

The text editor often replaces the line breaks with empty paragraphs <p>nbsp;<p>. Paragraphs with a margin can weaken the look of your website. This module provides a text filter that replaces empty paragraphs, for example <p></p> or <p>&nbsp;</p> with <br /> tags.

Remove empty paragraphs

This module also allows you to remove empty paragraphs if you want to delete them completely. This is not recommended because sometimes the editor needs to add an extra space between the text.

Configuration

  1. Go to 'Text formats and editors' on the page '/admin/config/content/formats'
  2. Add a new text format or edit an existing one
  3. In the chosen text format, select the 'Improve line breaks' option
  4. Change its order on the list
  5. If you want to completely delete empty paragraphs set checkbox 'Remove empty paragraphs' on the 'Improve line breaks' tab in the 'Filter settings'
  6. Click on the 'Save configuration' button

Notice: The Improve line breaks filter should be triggered after the 'Convert line breaks into HTML' and 'Correct faulty and chopped off HTML' if these are selected.

This module skip ignore tags (script, style, code, pre, object, iframe) when it replaces or removes unnecessary paragraphs.

Drupal 8–11

Ask your assistant about Improve Line Breaks 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

  • filter Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jun 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
8.x-1.7 Stable 8–11 Oct 30, 2024
8.x-1.6 Stable 8–10 Jun 26, 2024