This one exists longest:
https://drupal.org/project/emptyparagraphkiller

I think there's at least one more, but I forgot which

Perhaps join forces?

Comments

czigor’s picture

Status: Active » Closed (won't fix)

These two modules do not do the same. https://drupal.org/project/emptyparagraphkiller removes all empty paragraphs from the text. Trim HTML removes trailing empty paragraphs and line breaks.

I searched for a module with this functionality but could not find any.

rv0’s picture

I had to take a look at the code to see what was meant by trailing empty paragraphs

Perhaps this part of the code would be suitable info on the project page:

Remove all <br/> and empty (i.e. containing only whitespace or &nbsp;) <p> tags from the end of $text.

Also, I said "similar" modules, not "identical" ;) Too late now ..

alan d.’s picture

Both are modules that use filter formats to trim trailing empty text. Did you think about supplying a patch in the other queue to handle BR? Probably would have been 6 characters or so...

But now it is in the published module domain, it can not be reverted :/

The regex breaks with any attribute, well anything between the P and closing angle bracket. If uppercase characters are used (use /i), if the tag spans multiple lines, ...