if (prevParagraph.getEndOffset() != endOffset)
if (paragraph.getStartOffset() != endOffset)
  short handleInsertAfterNewline(Vector specs, int offset, int endOffset,                                Element prevParagraph, Element paragraph,                                AttributeSet a)  {    if (prevParagraph.getParentElement() == paragraph.getParentElement())      {        specs.add(new ElementSpec(a, ElementSpec.EndTagType));        specs.add(new ElementSpec(a, ElementSpec.StartTagType));        if (prevParagraph.getEndOffset() != endOffset)          return ElementSpec.JoinFractureDirection;        // If there is an Element after this one, use JoinNextDirection.        Element parent = paragraph.getParentElement();        if (parent.getElementCount() > (parent.getElementIndex(offset) + 1))          return ElementSpec.JoinNextDirection;      }    return ElementSpec.OriginateDirection;  }