diff --git a/plugins/grazie/src/test/testData/ide/language/xml/Example.html b/plugins/grazie/src/test/testData/ide/language/xml/Example.html index a5e9e835b5ab..6f4c55fc95e6 100644 --- a/plugins/grazie/src/test/testData/ide/language/xml/Example.html +++ b/plugins/grazie/src/test/testData/ide/language/xml/Example.html @@ -8,6 +8,10 @@

Example hedder with a error, so what?

\ it are error in tag atributee. And here are some correct English words to make the language detector work."> +
Hello
+ +This is <GRAMMAR_ERROR descr=an mistake" src="foo.png"/> + Some widely used comparison methods (e.g. String.compareTo) actually return values. diff --git a/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlTextExtractor.java b/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlTextExtractor.java index 72c27e9afbc1..f0880e193eca 100644 --- a/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlTextExtractor.java +++ b/plugins/grazie/xml/main/kotlin/com/intellij/grazie/ide/language/xml/XmlTextExtractor.java @@ -227,6 +227,19 @@ public class XmlTextExtractor extends TextExtractor { super(HTMLLanguage.class); } + @Override + protected @NotNull List buildTextContents(@NotNull PsiElement element, + @NotNull Set allowedDomains) { + if (PsiUtilCore.getElementType(element) == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN && + element.getParent() instanceof XmlAttributeValue value && + value.getParent() instanceof XmlAttribute attr && + "class".equalsIgnoreCase(attr.getName())) { + return List.of(); + } + + return super.buildTextContents(element, allowedDomains); + } + @Override protected Function tagClassifier(@NotNull PsiElement context) { if (!Registry.is("grazie.html.concatenate.inline.tag.contents")) {