4 document
.addEventListener('DOMContentLoaded', () => {
5 const code
= document
.querySelector("code[contenteditable=false]");
6 // For emulating the traditional behavior, collapse Selection to end of the
7 // last text node in the <code> which is the last inline container of the
9 getSelection().collapse(code
.lastChild
, code
.lastChild
.length
);
10 code
.querySelector("br").contentEditable
= true;
11 document
.execCommand("indent");
15 <b contenteditable hidden
>
17 <code contenteditable=
"false">