mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
HTML: don't report missing close tag on empty collapsed tag (WEB-33628)
This commit is contained in:
@@ -48,7 +48,9 @@ public class HtmlMissingClosingTagInspectionTest extends LightPlatformCodeInsigh
|
||||
quickfixTest("<html><<warning descr=\"Element <p> is missing an end tag\">p</warning><caret>>Behold!</html>", "<html><p>Behold!</p></html>", "Add </p>");
|
||||
}
|
||||
|
||||
|
||||
public void testCollapsedEmptyTag() {
|
||||
highlightTest("<html><body><App/></body></html>");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected LocalInspectionTool getInspection() {
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.psi.xml.XmlText;
|
||||
import com.intellij.psi.xml.XmlToken;
|
||||
import com.intellij.psi.xml.XmlTokenType;
|
||||
import com.intellij.xml.util.HtmlUtil;
|
||||
import com.intellij.xml.util.XmlTagUtil;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
@@ -36,6 +37,9 @@ public class HtmlMissingClosingTagInspection extends HtmlLocalInspectionTool {
|
||||
if (child instanceof PsiErrorElement) {
|
||||
return;
|
||||
}
|
||||
if (child != null && child.getNode().getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END) {
|
||||
return;
|
||||
}
|
||||
final XmlToken tagNameElement = XmlTagUtil.getStartTagNameElement(tag);
|
||||
if (tagNameElement == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user