docs: function ( range, root ) {
      var container = range.endContainer,
          block, child;
  
      // If inline, get the containing block.
      if ( isInline( container ) ) {
        block = getPreviousBlock( container, root );
      } else if ( container !== root && isBlock( container ) ) {
        block = container;
      } else {
        block = getNodeAfter( container, range.endOffset );
        if ( !block || !isOrContains( root, block ) ) {
          block = root;
          while ( child = block.lastChild ) {
            block = child;
          }
        }
        block = getPreviousBlock( block, root );
      }
      // Check the block actually intersects the range
      return block && isNodeContainedInRange( range, block, true ) ? block : null;
    }