code: function emptyEditorOnDeleteEverything() {
          function isEverythingSelected(editor) {
            var caretWalker = new CaretWalker(editor.getBody());
            var rng = editor.selection.getRng();
            var startCaretPos = CaretPosition.fromRangeStart(rng);
            var endCaretPos = CaretPosition.fromRangeEnd(rng);
            var prev = caretWalker.prev(startCaretPos);
            var next = caretWalker.next(endCaretPos);
  
            return !editor.selection.isCollapsed() &&
              (!prev || (prev.isAtStart() && startCaretPos.isEqual(prev))) &&
              (!next || (next.isAtEnd() && startCaretPos.isEqual(next)));
          }
  
          // Type over case delete and insert this won't cover typeover with a IME but at least it covers the common case
          editor.on('keypress', function (e) {
            if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode > 31 && !VK.metaKeyPressed(e)) {
              if (isEverythingSelected(editor)) {
                e.preventDefault();
                editor.setContent(String.fromCharCode(e.charCode));
                editor.selection.select(editor.getBody(), true);
                editor.selection.collapse(false);
                editor.nodeChanged();
              }
            }
          });
  
          editor.on('keydown', function (e) {
            var keyCode = e.keyCode;
  
            if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
              if (isEverythingSelected(editor)) {
                e.preventDefault();
                editor.setContent('');
                editor.nodeChanged();
              }
            }
          });
        }
docs: Properly empties the editor if all contents is selected and deleted this to
  prevent empty paragraphs from being produced at beginning/end of contents.