Whenever I copy code from a Stack Overflow post and try to paste it into Visual Studio or Notepad, all the carriage returns are lost and I have to go through and fix everything. Is there a proper way to do this so the carriage returns are maintained?
Also I believe this is on the Google code prettify guys' radar now, as I saw multiple tickets on it. It is easier for them to fix!
Update: the latest version of Prettify was deployed a few days ago; I verified that I can copy and paste from Internet Explorer in the sample post demonstrating the original issue fine. Kudos to Mike Samuel at Google for getting this fix in!
It seems to be back again: Prettified code copied in Internet Explorer pastes without line breaks (I agree)
I have the same problem with IE8. I made a pasting test in C#. If I use the command
string s = System.Windows.Forms.Clipboard.GetText();
s contains no CR and no LF, just spaces (" ") in the positions where the line breaks should be.
string s = System.Windows.Forms.Clipboard.GetText(TextDataFormat.Html);
however, I get some HTML code within which code examples from stackoverflow are hardly recognizable. Probably MS-Word decodes this HTML code, but VS and other editors fail to do so.