void () { myElementEndOffset = Character.offsetByCodePoints(myText, myElementStartOffset, 1); myCodePoint = Character.codePointAt(myText, myElementStartOffset); myLineBreak = false; if (myCodePoint == '\n') { myLineBreak = true; } else if (myCodePoint == '\r') { char secondChar = myElementEndOffset < myText.length() ? myText.charAt(myElementEndOffset) : 0; if (secondChar != '\n') { myLineBreak = true; } else if (myElementEndOffset < myIterationState.getEndOffset()) { myLineBreak = true; myElementEndOffset++; } } }