1 <p>This tests for a bug where links that weren't fully selected would be copy/pasted as plain text.</p>
2 <div id="copy">This should be plain text. <a id="anchor" href="http://www.google.com/">This should be a link.</a> This should be plain text.</div>
3 <div id="paste" contenteditable="true"><br></div>
6 var anchor = document.getElementById("anchor");
7 var sel = window.getSelection();
8 var range = document.createRange();
9 range.selectNodeContents(anchor);
12 document.execCommand("Copy");
14 var paste = document.getElementById("paste");
16 document.execCommand("Paste");