Prettified code copied in Internet Explorer pastes without line breaks
When I copy code from Stack Overflow into Visual Studio 2010, all the line feeds seem to be gone. I need to copy code into Word and then copy from Word to Visual Studio. Can Stack Overflow reformat these Code boxes to work with Visual Studio?
For example, the code fragment at C# Encrypt an XML File, when it is copied and pasted into Visual Studio, goes in as one big line.
Here is the code from the link I included. It is short and simple. I actually am using this fragment:
key = new RijndaelManaged(); byte passwordBytes = Encoding.UTF8.GetBytes("Password1234"); //password here byte saltBytes = Encoding.UTF8.GetBytes("Salt"); // salt here (another string) PasswordDeriveBytes p = new PasswordDeriveBytes(passwordBytes, saltBytes); // sizes are devided by 8 because [ 1 byte = 8 bits ] key.IV = p.GetBytes(key.BlockSize / 8); key.Key = p.GetBytes(key.KeySize / 8);
This is how code goes into Visual Studio. As you can see, the linebreaks are mangled.
If fixing this is low priority, just say so; but don't insult my intelligence by telling me to use another browser or that copy/paste is foolish.
When used, someone has to go through this code and sort it all out. Sometimes we are looking at a lot of lines. Stack Overflow provides a great place to share/learn. But why should I have to type things like this in order to use the knowledge?