We've noticed that IE7 has an odd behavor with code blocks posted on Stack Overflow. For example, this little code block:
public PageSizer(string href, int index)
{
HRef = href;
PageIndex = index;
}
Copy and pasted from IE7, ends up like this:
public PageSizer(string href, int index){ HRef = href; PageIndex = index; }
Not exactly what we had in mind.. the underlying HTML source actually looks fine; if you View Source, you'll see this:
<pre><code>public PageSizer(string href, int index)
{
HRef = href;
PageIndex = index;
}
</code></pre>
So what are we doing wrong? Why can't IE7 copy and paste this HTML in a rational way?
Update: this specifically has to do with
<pre>
<code>
blocks that are being modified at runtime via JavaScript. The native HTML does render and copy correctly; it's the JavaScript modified version of that HTML which doesn't behave as expected. Note that copying and pasting into WordPad or Word works because IE is putting different content in the rich text clipboard compared to the plain text clipboard that Notepad gets its data from.