Skip to content

Instantly share code, notes, and snippets.

@fuzenco
Created February 27, 2012 03:12
Show Gist options
  • Save fuzenco/1921054 to your computer and use it in GitHub Desktop.
Save fuzenco/1921054 to your computer and use it in GitHub Desktop.
Remove those pesky CKEditor unwanted paragraphs
In jQuery:
<script type="text/javascript">
$('p').each(function() {
var $this = $(this);
if($this.html().replace(/\s|&nbsp;/g, '').length == 0)
$this.remove();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment