12 lines
524 B
HTML
12 lines
524 B
HTML
<p>This tests for a bug when removing links from a selection with Unlink. There shouldn't be any links *inside the selection* below.</p>
|
|
<div contenteditable="true"><a href="http:://www.google.com/"><div>Hel<span id="start">lo</span></div></a><div><span id="end">W</span>orld!</div></div>
|
|
|
|
<script>
|
|
var start = document.getElementById("start");
|
|
var end = document.getElementById("end");
|
|
var sel = window.getSelection();
|
|
sel.setBaseAndExtent(start, 0, end, end.childNodes.length);
|
|
|
|
document.execCommand("Unlink");
|
|
</script>
|