<p>This tests for a hang when pasting underlined content at the end of a paragraph.  You should see 'Hello <u>World!</u>' below.</p>

<div id="div" contenteditable="true"><div>Hello&nbsp;</div></div>

<script>
var sel = window.getSelection();
var div = document.getElementById("div");
sel.setPosition(div, div.childNodes.length);
document.execCommand("InsertHTML", false, "<span style='text-decoration: underline;'><div>World!</div></span>");
</script>
