blob: 54baf4d005b6678ca4500eff81609698f218fdc1 [file] [log] [blame]
<p>This tests for a bug where hitting return after a line break in text that preserves newlines wouldn't do anything.</p>
<div id="div" contenteditable="true" style="white-space: pre;">xxx
There should be an empty paragraph before this one, and the caret should be at the start of this paragraph.</div>
<script>
var sel = window.getSelection();
var div = document.getElementById("div");
var text = div.firstChild;
sel.collapse(text, 4);
document.execCommand("InsertParagraph");
</script>