mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +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>");
|
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
|
@NotNull
|
||||||
protected LocalInspectionTool getInspection() {
|
protected LocalInspectionTool getInspection() {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
|||||||
import com.intellij.psi.xml.XmlTag;
|
import com.intellij.psi.xml.XmlTag;
|
||||||
import com.intellij.psi.xml.XmlText;
|
import com.intellij.psi.xml.XmlText;
|
||||||
import com.intellij.psi.xml.XmlToken;
|
import com.intellij.psi.xml.XmlToken;
|
||||||
|
import com.intellij.psi.xml.XmlTokenType;
|
||||||
import com.intellij.xml.util.HtmlUtil;
|
import com.intellij.xml.util.HtmlUtil;
|
||||||
import com.intellij.xml.util.XmlTagUtil;
|
import com.intellij.xml.util.XmlTagUtil;
|
||||||
import org.jetbrains.annotations.Nls;
|
import org.jetbrains.annotations.Nls;
|
||||||
@@ -36,6 +37,9 @@ public class HtmlMissingClosingTagInspection extends HtmlLocalInspectionTool {
|
|||||||
if (child instanceof PsiErrorElement) {
|
if (child instanceof PsiErrorElement) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (child != null && child.getNode().getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final XmlToken tagNameElement = XmlTagUtil.getStartTagNameElement(tag);
|
final XmlToken tagNameElement = XmlTagUtil.getStartTagNameElement(tag);
|
||||||
if (tagNameElement == null) {
|
if (tagNameElement == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user