3

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.

Arjan
28.3k18 gold badges114 silver badges177 bronze badges
asked Feb 8, 2012 at 3:26
11
  • 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? Commented Feb 8, 2012 at 3:33
  • 3
    What browser do you use? This was previously an issue in IE, but it was fixed. Commented Feb 8, 2012 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. Commented Feb 8, 2012 at 3:49
  • Errr, on a truly serious note: you did not try to add any newlines in your original post above, did you? Commented Feb 8, 2012 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. Commented Feb 8, 2012 at 6:57
  • Similarly, the revision sources should be provided as plain-text/raw. They are currently provided using HTML and CSS. Commented Feb 8, 2012 at 7:21
  • @iglvzx, you can click "source" in a revision overview to get the (Markdown) text. Commented Feb 8, 2012 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. Commented Feb 8, 2012 at 22:06
  • Misleading indeed, @iglvzx: I always figured it was just plain text I was looking at! Commented Feb 8, 2012 at 22:23
  • @Arjan Feature-requested: meta.stackexchange.com/questions/121725/… Commented Feb 8, 2012 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. Commented Feb 10, 2012 at 8:52

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.