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

Possible Duplicate:
Should the markdown renderer treat a single line break as <br>?

In markdown a <br> is inserted if you end a line with a double space
I find this feature particularly confusing.

Is there a reason why markdown swallows new lines? Should SO make a modification so new lines are treated with respect without the double space hack?

share|improve this question

marked as duplicate by Shog9, Jeff Atwood Mar 3 '10 at 7:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
+1, I thought because of regex implementation, but still want to know correct reason why It cannot/shouldn't be done. –  YOU Mar 3 '10 at 6:24
1  
Yes, no. See "Should the markdown renderer treat a single line break as <br>?" at meta.stackexchange.com/questions/26011/… –  Arjan Mar 3 '10 at 6:32
add comment

1 Answer

up vote 10 down vote accepted

From the Markdown Syntax Documentation:

the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.

Traditionally, plain text email (and many other plain-text documents) were hard-wrapped: a newline would be inserted at the end of every line, as though you had typed it out on a typewriter. This has several advantages: words can be properly hyphenated to break them across lines, line-based diff tools (such as that used by SO's revision history) tend to work well with it, as do many other tools written for text processing (including a great many editors that even today will choke on very long lines).

Of course, the down side is that if you want your clients to properly differentiate between lines and paragraphs, re-flowing the former to make good use of wider screens while preserving the latter, then you need to demarcate paragraphs using something other than a single line-break.

Should SO make a modification so new lines are treated with respect without the double space hack?

I don't think so. First off, that would be a breaking departure from the Markdown spec, meaning that text written to that spec (including much of the content on SO) might not display correctly. But also... It really isn't that big of a deal, and does make things like the revision history, quote blocks, etc. easier to work with.

See also: Should the markdown renderer treat a single line break as <br>?

share|improve this answer
    
+1 for teaching me a new word: demarcate –  Dan Jun 19 at 13:57
add comment

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