`;
        };
        const report = () => println(`Div contents: "${divElm.innerHTML}" state: ${document.queryCommandState('bold')} selection: ${printableSelection()}`);
        report();

        // Make 'bar' bold
        range.setStart(divElm.childNodes[0], 3);
        range.setEnd(divElm.childNodes[0], 6);
        document.execCommand('bold');
        report();

        // Make 'foo' bold
        range.setStart(divElm.childNodes[0], 0);
        range.setEnd(divElm.childNodes[0], 3);
        document.ex