The platform I\'m building a website on produces empty p tags in wysiwyg mode. How can I take these out?
Something like this, perhaps...
$
The answer depends on what "empty" means. If the empty paragraphs are then fireeyedboy's p:empty selector is the way to go. If there could be spaces or newlines or other such things then you'll probably want something like this:
$('p').each(function() {
var $this = $(this);
if($this.html().replace(/\s| /g, '').length == 0)
$this.remove();
});
Example: http://jsfiddle.net/ambiguous/7L4WZ/
FCKEditor (not sure about CKEditor or TinyMCE) likes to add to the HTML so you might need the above somewhat ugly approach.