From ca28f9a0d577f70d78797525a4bd5f7176f719c6 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Thu, 3 Mar 2016 12:13:05 +0300 Subject: [PATCH] keep whitespaces inside inner tags #WEB-18909 fixed --- .../src/com/intellij/psi/formatter/xml/HtmlPolicy.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java b/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java index f89ceff8a601..b817d516495f 100644 --- a/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java +++ b/xml/impl/src/com/intellij/psi/formatter/xml/HtmlPolicy.java @@ -143,7 +143,14 @@ public class HtmlPolicy extends XmlFormattingPolicy { @Override public boolean keepWhiteSpacesInsideTag(final XmlTag tag) { - return checkName(tag, mySettings.HTML_KEEP_WHITESPACES_INSIDE) || "jsp:attribute".equals(tag.getName()); + XmlTag current = tag; + while (current != null) { + if (checkName(current, mySettings.HTML_KEEP_WHITESPACES_INSIDE) || "jsp:attribute".equals(current.getName())) { + return true; + } + current = current.getParentTag(); + } + return false; } @Override