docs: function ( range, node ) {
      // Insert at start.
      var startContainer = range.startContainer,
          startOffset = range.startOffset,
          endContainer = range.endContainer,
          endOffset = range.endOffset,
          parent, children, childCount, afterSplit;
  
      // If part way through a text node, split it.
      if ( startContainer.nodeType === TEXT_NODE ) {
          parent = startContainer.parentNode;
          children = parent.childNodes;
          if ( startOffset === startContainer.length ) {
              startOffset = indexOf.call( children, startContainer ) + 1;
              if ( range.collapsed ) {
                  endContainer = parent;
                  endOffset = startOffset;
              }
          } else {
              if ( startOffset ) {
                  afterSplit = startContainer.splitText( startOffset );
                  if ( endContainer === startContainer ) {
                      endOffset -= startOffset;
                      endContainer = afterSplit;
                  }
                  else if ( endContainer === parent ) {
                      endOffset += 1;
                  }
                  startContainer = afterSplit;
              }
              startOffset = indexOf.call( children, startContainer );
          }
          startContainer = parent;
      } else {
          children = startContainer.childNodes;
      }
  
      childCount = children.length;
  
      if ( startOffset === childCount ) {
          startContainer.appendChild( node );
      } else {
          startContainer.insertBefore( node, children[ startOffset ] );
      }
  
      if ( startContainer === endContainer ) {
          endOffset += children.length - childCount;
      }
  
      range.setStart( startContainer, startOffset );
      range.setEnd( endContainer, endOffset );
  }