Empty paragraphs being removed in posts upons submission

How can I keep empty paragraphs for spacing when writing posts?

When I submit a post, empty paragraphs are automatically stripped out, but I’d like to keep them for extra spacing.

Is there a simple way or a plugin available that will allow this?

What I don’t want to have to do is editing the post on the HTML tab. That kind of defeats the purpose of making things simple (Non-programmers will be posting as well)

It would be better to put extra padding or margins on the paragraphs via CSS.

I don’t need the extra margins/padding on every paragraph.

I use the extra paragraph to break up content a little bit.

In that case, just target the elements that need spacing and add the padding/margins to those. This is much better that filling the page with junk tags.

PS If you want, show us a page and indicate where the spacing needs to be, and we can suggest how to edit the CSS.

The Non-programmer who’s going to be posting won’t be able to (and shouldn’t have to). That’s the problem.

How is an empty paragraph a junk tag?

<p>content content content</p>
<p>more content content content</p>
<p>slightly different content content content</p>

The idea with CSS is that you, the developer, set styles so that the client never has to worry about the issue.

How is an empty paragraph a junk tag?

In the same way that an empty wrapper is junk. What you are looking for is a presentational change, so it’s best not to use structural elements for this purpose.

<p>more content content content</p>
<p> </p>
<p>slightly different content content content</p>

It looks like you need a heading between these two bits of content.

Really, though, you have not mentioned what CMS you are using, so no really definite advice can be given.

But I would still recommend setting up the system so that presentation is handled by CSS during the design phase. Of course, this should not be an issue posters should have to worry about.

I’m guessing you’re doing this with WordPress? If so you can either hack the core code or use a plugin to avoid using the core’s “smart (and I say that facetiously) text formatting” feature.

Or if you don’t mind how it looks, don’t use empty paragraphs. Have them contain a relatively minute character like a period . or a backtick `

Personally I would give them a class attribute, but if you don’t want to burden your non-CSS savvy user’s you’re limited.

oops, thought I mentioned it. Yeah, it’s wordpress.

Any idea where I might start for altering the smart text formatting feature? Although, I was hoping to avoid that since the changes would probably we wiped out with an update.

Yes, hacking core code can be a real pain. And it needs to be re-thought and re-done every upgrade. IMHO it’s better to trust that a plugin author has done the job correctly for you and use a plugin http://wordpress.org/extend/plugins/search.php?q=text+formatting&sort=

If you try a few you should be lucky enough to find what you need. You’re not the only WordPress user that has experienced this problem by a long shot.

If your users are adding posts with the WYSIWYG view—and if you don’t mind slightly unsemantic code—you could just use something like the <h6> tag to insert a space. (h6 is nver really needed anyway.)

In the CSS, you could set the h6 tag to something like this:

h6 {
  position: relative;
  padding: 0;
  margin: 0;
  height: xxpx; /* set to whatever height you want the gap to be */

That should place the header way off screen but still leave a space for it.

You could tell the user to type something like “space”, then highlight it and click heading 6 in the formatting menu.

Certainly hacky, but it would be an easy solution if that’s what you are after.

I sure wish there was a standard solution…I see lots of similar questions, but no good answers.

The h6 thing sounds decent, but I can just see the user getting confused by having to do that just to get an extra line spacing.

Whatever method is used, you will have to explain it to the user. This at least would be an easy trick to learn. All the same, I guess it does highlight that an ideal solution is lacking.

I would like to see an example of a situation in which you’d want to use this, though. It just sounds like a odd need. It sounds like there might be a regular situation in which this extra space is needed, say above a heading, in which case CSS is still the answer.

Another hack idea would be to use an image–say a spacer gif. I think WP wraps images in <p> tags, which would give you your paragraph tags. At least them you could say to the user—“to get the space you want, you insert the Space image”. Perhaps that’s easier to understand and remember.