XmlBlock (@NotNull ASTNode child, @Nullable Indent indent, @Nullable Wrap wrap, @Nullable Alignment alignment) { var text = child.getText(); var textStart = StringUtil.skipWhitespaceOrNewLineForward(text, 0); var textEnd = StringUtil.skipWhitespaceOrNewLineBackward(text, text.length()); TextRange textRange; if (textStart < textEnd) { textRange = child.getTextRange(); textRange = new TextRange(textRange.getStartOffset() + textStart, textRange.getStartOffset() + textEnd); } else { textRange = null; } return new XmlBlock(child, wrap, alignment, myXmlFormattingPolicy, indent, textRange, isPreserveSpace()); }