What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

When I post a question and want to add a new line, I have to press Return two times, or else the next text will appear on the same line.

Is this really supposed to behave this way? If so, why?

share|improve this question
    
See here: meta.stackoverflow.com/editing-help –  Jon Seigel Apr 6 '10 at 2:09
    
This is the way that Markdown is designed. Please read the link that Jon Seigel provided to you. –  John Saunders Apr 6 '10 at 2:38
    
And, now that you know about the two spaces (while <br> is not the same as the <p> that is inserted when using a blank line): Should the markdown renderer treat a single line break as <br>? –  Arjan Apr 6 '10 at 6:18
add comment

4 Answers

This is real, and there's a reason for this. It's two-fold, actually.

First, there is a huge difference between a line break and a paragraph break. A line break is just that: The reading flow continues on the next line; your eyes automatically jump from the end of the previous line to the beginning of the next.

So the purpose of a line break is to not be seen.

A paragraph break, on the other hand, gives your eyes room to breathe, so to speak. Paragraphs are used to break up text into smaller blocks so that reading happens more rhythmically and not inonegiantwalloflettersthatneverseemstostopohmycanitendalreadyineedtotakeabreak.

How exactly a paragraph break is presented often depends on the country and/or the language. Usually it's one of two ways: Either there is a bit of white space between the paragraphs (as it is done on Stack Overflow), or the first line of a paragraph is indented.
    That's this way. Of course you can also combine both ways. Either way, there is a visual break between the two paragraphs, so the reader automatically takes a breath at the point.

When people press Return in MS Word or OpenOffice Writer, they often expect this to create a line break (or "newline"). But the fact that after pressing that key writing continues on the next line is just a side effect of a paragraph break.

If your first-line indent or the pre- or post-space is non-zero in the paragraph settings, you'll notice that a lot more happens than just a newline. (Microsoft changed their Office defaults, so beginning with Office 2007, a paragraph break in Word actually does look different than a line break. This tends to confuse a lot of people who don't make this distinction.)

Especially when writing text, it is very rare to insert a manual line break; most of the time, you'll leave it to your word processor to jump to the next line when there's no more space left on this one.

Here's one of the rare examples where you actually want to insert a line break, but not a paragraph break:

When the woman asked him to help her with carrying her many bags, he took a nap
sack from the luggage compartment. As a Gentleman, he wouldn't say no to a lady.

(the key to insert a line break in Word and in OOo is <Shift>-Return, by the way.)

Okay, what was your question again? Ah, yes. Markdown was created to be written in a way similar to the way plain text emails are written: Dashes as underlines, words in *stars* to denote emphasis, etc.

To denote paragraph breaks in emails, you would usually use the white-space variant, not the indentation variant; especially since it often happens that space characters are stripped, which could lead to you losing your paragraph breaks (and thus readability).

But since in plain text emails there is no way to insert a nice automatic .7em post-paragraph spacing, the standard way to seperate paragraphs is inserting an empty line. And so this practice was carried over to Markdown.

The second reason is that you can't be sure about the screen width the recipient of your email would have. If your email is wrapped to 79 characters per line, but it is read at 70 characters per line, you either have alternating long line – short line – long line – short line etc., which isn't really fun to read; or your email program rewraps the lines by [there it is:] ignoring single line breaks.

As to the question why a real line break in markdown is created with two trailing spaces – I don't know. Maybe because it's the opposite of a two-character indent, so it's a "non-paragraph break".

Whatever the reason: Remember that in normal text flow, you usually don't want to insert a line break, you want to insert a paragraph break. This is even more true when your text ends up as HTML, so you can't tell anyway how it's going to render on the reader's screen.

share|improve this answer
19  
When you write answers on Meta which are more than a page high, you clearly have too much free time. Great answer, though. –  Gnoupi Apr 6 '10 at 8:30
1  
And for those still not convinced: compare the above to the version without whitespace. –  Arjan Mar 4 '12 at 12:47
1  
Do you know why the double-spaces trick is so prominently explained in the Markdown help? It currently is the second thing we're (wrongly) teaching people! I'd love it to explain that empty lines are to be preferred. Like: Linebreaks Use a blank line to start a new <p> paragraph. Only when really needed, end a line with two spaces to add a <br/> linebreak. –  Arjan Apr 28 '12 at 18:05
    
I was unsure about whether to edit "nap sack" as it has the feeling of a quote but I couldn't find where from... Did you mean knapsack? –  ben is uǝq backwards Jan 26 '13 at 17:38
    
Nope, @Ben, "took a knap" would spoil the joke (and hence the example), wouldn't it? –  Arjan Jan 26 '13 at 17:45
    
Thank you @Arjan, apparently I'm obviously not on form for wordplay today... –  ben is uǝq backwards Jan 26 '13 at 17:46
    
@benisuǝqbackwards I did, but for some reason I thought it's spelled this way (although there is in fact a brand name "Napsack"). But as Arjan says, it doesn't make sense to fix this. If someone comes up with a better example of the point I'm making, I'm fine to have it changed. –  balpha Jan 26 '13 at 17:47
    
No @balpha, this is a perfect example (once Arjan has pointed out the reasoning for us slower people). –  ben is uǝq backwards Jan 26 '13 at 17:53
    
A more straightforward example would be quoting poetry. –  TRiG is Timothy Richard Green Apr 5 '13 at 3:29
    
@TRiG, I disagree about using poetry as an example, as the current example (and its joke) explains why one often does not want an explicit line break. :-) –  Arjan Aug 13 '13 at 7:59
add comment

It's part of the Markdown spec. If you really want just a line break, you can put two spaces at the end of the line or use an html line break (<br>).

share|improve this answer
2  
A <br> (inserted when using two spaces) is not the same as a <p> (resulting from a blank line). So, "really" should read: really, in very rare occasions :-) Respect the layout of the website, which happens to have some whitespace defined around paragraphs. –  Arjan Apr 6 '10 at 6:20
    
Here you've spoken against <br/>, perhaps this answer needs a little remodeling ;) –  Zuul Jul 25 '12 at 10:06
add comment
And as for the why: because while editing in plain text it looks much better.

This new paragraph is clearly separated from the previous one.

And as for the why: because while editing in plain text it looks much better.
This new paragraph is not so clearly separated from the previous one.
share|improve this answer
add comment

As others have mentioned, it's a Markdown oddity. Hopefully someone will come along some day and fix it. It's not very user friendly the way it is.

share|improve this answer
8  
Hardly an oddity, it is quite common for a blank line in markup to indicate a new paragraph and has a long history (I first encountered it in TeX). –  Richard Apr 6 '10 at 9:33
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .