html formatter: don't force wrap before first top-level tag (may be root block in injection where wrap is not needed)

Fixes WEB-25814

GitOrigin-RevId: 28f2cfad7d2d8e852cde25f30ff7c58d81c00ed1
This commit is contained in:
Maxim Kropotov
2019-05-22 16:23:01 +03:00
committed by intellij-monorepo-bot
parent 5a75edf6e2
commit 30b6d83993
@@ -152,6 +152,9 @@ public abstract class AbstractXmlBlock extends AbstractBlock {
}
protected Wrap createTagBeginWrapping(final XmlTag tag) {
if (!(tag.getParent() instanceof XmlTag) && FormatterUtil.getPreviousNonWhitespaceSibling(tag.getNode()) == null) {
return null;
}
return Wrap.createWrap(myXmlFormattingPolicy.getWrappingTypeForTagBegin(tag), true);
}