3 ms·
"Item #3, the conversion of returns to linebreaks, is somewhat more debatable. I'm on the fence on that one, but I do believe it's significant enough to warrant
by billpg 17y ago
"Item #3, the conversion of returns to linebreaks, is somewhat more debatable. I'm on the fence on that one, but I do believe it's significant enough to warrant an explicit choice either way."
Really?
Has anyone ever typed stuff, hit enter once, then typed more stuff, ever not intended a line break?
"Oh no, I kept hitting Enter between words instead of using the space-bar! If only pressing Enter was interpreted as a space character unless it was prefixed by four spaces. What a world! What a world!"
- andrewcooke 17y agosome people hit return when the text is nearing the end of the input box. as in this text, which has "return" after "end of".
- billpg 17y ago(Edit: I think I was a bit rash in this message, stemming from my sense of sheer disbelief. While I stand by my overall point, I would like to apologize for my tone.) Really? I can't recall the last time I saw a multi-line text box that didn't word-wrap. That may have made sense back in the day when TEXTAREA form elements didn't wrap and there was no way to switch the wrapping on, but its been over 10 years since that was the case. Do people still do that? Even in the presence of people needlessly hitting enter because they don't realise the input box will word-wrap, the effect of doing the-wrong-thing still seems preferable with turning enter key presses into line breaks. The worst that happens when you hit enter at the end of the input box is a narrow column of text. If you expect hitting Enter to result in a line-break, doing the-wrong-thing results in text being wrongly joined together into one paragraph.
- andrewcooke 17y agodude, i'm telling you what people do. perhaps your problem is confusing people with computers?
- billpg 17y agoFair enough. My point would be that if people are still doing that, they don't have to anymore. Also, my earlier response was written a little rashly, stemming for my sense of sheer disbelief. While I stand by my overall point, I'd like to apologise for my tone.
- telemachos 17y agoI'm not sure of the origin of the convention, but using two newlines consistently to mark new paragraphs (rather than indentation or just one newline) seems awfully common to me in technical writing. So the Markdown rule has always made sense to me. Or to put it another way, it was immediately natural to do it that way. Edit: to answer the question of the comment below this, poems need to be handled specially in Markdown as in HTML. It's an issue more generally, and I think that the standard solution is <p> for the poem as a whole and <br> (or <br /> depending on your markup flavor preference) for the lines. It's a known thing: http://blog.signified.com.au/a-poem-element-for-html5/ http://blog.signified.com.au/a-poem-element-for-html5/
- nollidge 17y agoBut what if you want a newline for a reason other than for paragraphs, like a poem or something?
- technomancy 17y agoThen you end the line in two spaces.
- StrawberryFrog 17y agoHow obvious!
- nostrademons 17y agoI always just indent poems 4 spaces, making them into preformatted text. In published work, poems are usually set apart from the prose and rendered in a different font anyway, so this seems natural enough to me. Courier isn't exactly my first choice for a poetic font, but it's good enough and gets the formatting across.
- lutorm 17y agoYes, I have. When you hit alt-q in emacs, you do, too. It goes with the theme of "making it look like you write ascii files". Have you never tried to read an ascii file that's written without line breaks in an xterm? When programming, do you never cut lines with enter except after the semicolon either?
- billpg 17y agoWhen writing code, I hit enter to add a line-break in order to make the code look nice. I would consider it a bad thing if next time someone looked at the code, those line-breaks were removed and changed to spaces, even if the code was technically equivalent. Compilers (except maybe Python) don't care about layout.
- almost 17y agoVery much so. One of the cool things about markdown is it looks good in source form as well as after processing to HTML. In order to keep that looking good you of course keep your lines to under 80 characters. That makes sense in fixed width ASCII but no so much once it's gone to HTML.
- deleted 17y ago[deleted]
- fr0sty 17y agoAlternatively: "Oh no, I'm trying to paste this block of text from an email and it thinks every line is a new paragraph!" Besides, Markdown was designed to be readable as plaintext and test written with the expectation that single return -> linebreak is not easily readable (unless people are in the habit of indenting the first line of their paragraphs.
- billpg 17y agoThat still happens? Have I been watching Doctor Who too much and I've been transported back to the 90s?
- rapind 17y agoI agree. This is frustrating in many markup formats. A carriage return should turn into a br tag and two carriage returns should start a new paragraph. Simple, intuitive, where's the problem?? IMO any situation where that behaviour is undesirable is an edge case and should require more effort to work around.
- stevelosh 17y ago> Has anyone ever typed stuff, hit enter once, then typed more stuff, ever not intended a line break? Yes. It makes diffs of version-controlled documentation far, far more readable (and efficient). ^Q in TextMate does it for you, so it's not even much extra effort. Type your paragraph, ^Q to wrap it to 78/80/whatever characters. I think someone else mentioned that emacs has a similar feature, and I'm sure vim does too.