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

There's this relatively common syndrome where code pasted into the question is double-spaced (with a blank line in between every line of text) -- see for instance the earliest revisions of http://stackoverflow.com/posts/5128613/revisions -- it seems to happen more often with new posters who haven't figured out how to format stuff yet, but I really doubt they're coding that way, so I wonder if there's a bug somewhere that causes DOS line endings to become extra blank lines when pasted into the question-edit box.

share|improve this question

1 Answer 1

When I fetched original poster's source,

http://stackoverflow.com/revisions/1a0700d0-eaf6-421c-b9bf-2699755371b6/view-source

and I found that there is many \r\n\r\n sequences there. So I think that is not DOS issue, original texts is like that as is.

#include <iostream>\r\n\r\nusing namespace std;\r\n\r\nstruct list\r\n\r\n{\r\n\r\nchar name[20];\r\n\r\nint age;\r\n\r\ndouble height;\r\n\r\nlist *next;\r\n\r\n};\r\n\r\nlist *first = NULL, *current=NULL;\r\n\r\nint optn = 0;\r\n\r\nvoid currentfor()\r\n\r\n    {\r\n\r\n        if (current==NULL)\r\n\r\n        {\r\n\r\n         cout << "Current is invalid" <<.....
share|improve this answer
    
Hmm. The original poster commented "I tried putting the code without spaces but it looked so messed up in the preview.So wen i put spaces it came out decently in the coding format". So it looks like you're right and what we really need is to improve the UI for triggering code formatting. –  Zack Feb 26 '11 at 18:39
    
I must be missing something here. There's a tool for marking something as code. It's on the line that begins with the "B for bold" tool. It looks like a pair of braces. I like the way it formats code just fine. –  Walter Mitty Feb 26 '11 at 18:42
    
Select the raw code, and ctrl+k would be ok for code blocks normally, IHMO. I don't think SO will convert \r\n to \r\n\r\n though. –  YOU Feb 26 '11 at 18:50

You must log in to answer this question.

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