OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <p id="description">This tests inserting a text in the middle of a text node. Yo
u should see "1 Two 3" below.</p> | 4 <p id="description">This tests inserting a text in the middle of a text node. Yo
u should see "1 Two 3" below.</p> |
5 <pre id="test" contentEditable="true" style="border:1px solid black"> | 5 <pre id="test" contentEditable="true" style="border:1px solid black"> |
6 <b>1 <i>2 3</i></b> | 6 <b>1 <i>2 3</i></b> |
7 </pre> | 7 </pre> |
8 <script src="../../resources/dump-as-markup.js"></script> | 8 <script src="../../resources/dump-as-markup.js"></script> |
9 <script> | 9 <script> |
10 getSelection().selectAllChildren(document.querySelector('i')); | 10 getSelection().selectAllChildren(document.querySelector('i')); |
11 var text = document.querySelector('i').firstChild; | 11 var text = document.querySelector('i').firstChild; |
12 getSelection().setBaseAndExtent(text, 0, text, 1); | 12 getSelection().setBaseAndExtent(text, 0, text, 1); |
13 document.execCommand('InsertHtml', false, 'Two'); | 13 document.execCommand('InsertHtml', false, 'Two'); |
14 | 14 |
15 Markup.description(document.getElementById('description').textContent); | 15 Markup.description(document.getElementById('description').textContent); |
16 Markup.dump('test'); | 16 Markup.dump('test'); |
17 | 17 |
18 </script> | 18 </script> |
19 </body> | 19 </body> |
20 </html> | 20 </html> |
OLD | NEW |