code: function truncateNearestSibling($element, $rootNode, $clipNode, options) {
      var $parent = $element.parent();
      var $prevSibling;
  
      $element.remove();
  
      // Take into account length of $clipNode element previous inserted.
      var clipLength = $clipNode ? $clipNode.length : 0;
  
      if ($parent.contents().length > clipLength) {
  
        // Valid previous sibling element (sharing same parent node) exists,
        // so attempt to truncate it.
        $prevSibling = $parent.contents().eq(-1 - clipLength);
        return truncateTextContent($prevSibling, $rootNode, $clipNode, options);
  
      } else {
  
        // No previous sibling element (sharing same parent node) exists.
        // Therefore, search parent's sibling.
  
        var $parentSibling = $parent.prev();
        $prevSibling = $parentSibling.contents().eq(-1);
  
        if ($prevSibling.length) {
  
          // Because traversal is in-order so the algorithm already checked that
          // this point meets the height requirement. As such, it's safe to truncate here.
          setText($prevSibling[0], $prevSibling.text() + options.ellipsis);
          $parent.remove();
  
          if ($clipNode.length) {
            $parentSibling.append($clipNode);
          }
          return true;
        }
      }
  
      return false;
    }
docs: /* Truncate the nearest sibling node.
  If no valid immediate sibling is found, traverse one level up to a cousin node.
  
  $element  - The jQuery node to truncate.
  $rootNode - The jQuery root node to measure the truncated height.
  $clipNode - The jQuery node to insert right after the truncation point.
  options   - An object containing:
  ellipsis  - The ellipsis string to append at the end of the truncation.
  maxHeight - The maximum height for the root node (in px).
  position  - The position of the truncation ("start", "middle", "end").
  
  Returns true if truncation happened, false otherwise.