Jump to content

TextformatterRemoveEmptyParagraphs


bernhard
 Share

Recommended Posts

Stripping off empty paragraphs can be harder than it may sound:

As requested by @netcarver I put it into a textformatter module:

https://github.com/BernhardBaumrock/TextformatterRemoveEmptyParagraphs

https://modules.processwire.com/modules/textformatter-remove-empty-paragraphs/

TextformatterRemoveEmptyParagraphs

ProcessWire Textformatter to remove empty paragraphs from CKE fields

Removes empty paragraphs from a html string. A paragraph is considered to be empty if it only contains one or more of the following:

  • regular whitespace
  • UTF-8 encoded whitespace
  • all variants of <br/>

PS: I'm actually not sure if that makes sense as Textformatter at all. IMHO this should be done on processInput, so it's more a sanitization than a textformatter... @netcarver what do you think, as you requested this... ?

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...