code: public int[] correctPair(int leftOffset, int rightOffset) {
      rightOffset = correctEndOffsetForCloseElement(rightOffset);
      if (spansNonTaggable(leftOffset, rightOffset))
        return null;
  
      int startTag = lookupTag(leftOffset);
      //offsetPair[0] = Math.max(offsetPair[0], getOpenStartOff(startTag));
      int endTag = lookupTag(rightOffset-1);
      //offsetPair[1] = Math.min(offsetPair[1], getCloseStartOff(endTag));
  
      // Find the ancestor tag enclosing offsetPair.  And bump out left offset along the way.
      int iTag = startTag;
      for (; !tagEnclosesOffset(iTag, rightOffset); iTag = getParentTag(iTag)) {
        //Ensure there is nothing except whitespace thru OpenEndOff
        int tagOpenEndOff = getOpenEndOff(iTag);
        if (hasNonWhitespace(tagOpenEndOff, leftOffset))
          return null;
        leftOffset = getOpenStartOff(iTag);
      }
      final int ancestorTag = iTag;
      // Bump out rightOffset until we get to ancestorTag.
      for (iTag = endTag; iTag != ancestorTag; iTag = getParentTag(iTag)) {
        //Ensure there is nothing except whitespace thru CloseStartOff
        int tagCloseStartOff = getCloseStartOff(iTag);
        if (hasNonWhitespace(rightOffset, tagCloseStartOff))
          return null;
        rightOffset = getCloseEndOff(iTag);
      }
  
      offsetPair[0] = leftOffset;
      offsetPair[1] = rightOffset;
      return offsetPair;
    }
docs: Corrects the start and end offset pair. It will return null if it can't
  due to a failure to keep the offsets balance-able, or if it spans "non-taggable" tags.
  The start (left) offset is pulled left as needed over whitespace and opening tags. The end
  (right) offset is pulled right as needed over whitespace and closing tags. It's returned as
  a 2-element array.
  <p>Note that the returned array is internally reused; just use it to examine the response.