Improve line breaks filter settings

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.

abventor logo

Supporting organizations: 

Project information

Releases