When you go to 'copy' code from any of the pages, then 'paste' it in Notepad (or another text editor), it all comes out on one line, and has to be re-formatted.

Did the designers ever think of putting one of those "View as text" options on all 'code'? That, in my opinion, would be the crowning touch to this most excellent site.

  • 3
    I don't experience that behavior, to my recollection. I just checked out this question and copy/pasted the code, and it came out fine. What browser/editor are you using? – Andrew Barber Feb 8 '12 at 3:33
  • 3
    What browser do you use? This was previously an issue in IE, but it was fixed. – Jeremy Banks Feb 8 '12 at 3:46
  • 2
    The only reason I could think that would happen is if the web browser copies parsed HTML to the clipboard with a certain type of newline character, but it differs from the OS's preferred line ending. That would indeed be a weird bug. Makes sense if you're running your browser or dev environment in a Virtual Machine, though. – darvids0n Feb 8 '12 at 3:49
  • Errr, on a truly serious note: you did not try to add any newlines in your original post above, did you? – Arjan Feb 8 '12 at 6:52
  • Related: Is it possible to add a function (button) to select a complete code block in a question? and the things it links to. And when using the "pre select" Greasemonkey script, “Unformatting” a code block might help too. – Arjan Feb 8 '12 at 6:57
  • Similarly, the revision sources should be provided as plain-text/raw. They are currently provided using HTML and CSS. – iglvzx Feb 8 '12 at 7:21
  • @iglvzx, you can click "source" in a revision overview to get the (Markdown) text. – Arjan Feb 8 '12 at 17:21
  • 1
    @Arjan I should have been more clear. When you click "source", you are taken to a simple HTML page which formats the source in a styled pre element. The styling displays line-wrapping, which can be misleading. – iglvzx Feb 8 '12 at 22:06
  • Misleading indeed, @iglvzx: I always figured it was just plain text I was looking at! – Arjan Feb 8 '12 at 22:23
  • @Arjan Feature-requested: meta.stackexchange.com/questions/121725/… – iglvzx Feb 8 '12 at 22:47
  • I use good 'ol Notepad as my editor of choice. I tried Notepad++ :( The browser would not matter, I just want it formatted as is on the page. Interesting point though, I tried about 10 different posts, and some have line breaks when copy/paste, and others dont. I believe this may be from users copy/pasting code from thier own documents. STILL, I do love those sites that use Syntax Highlighter (I believe its called). Thank You all for your comments and suggestions. This is the only site I use where people who ask ?? questions are not critisized for not already having the answer. – Sparky Feb 10 '12 at 8:52

You must log in to answer this question.

Browse other questions tagged .