mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
IJPL-156597 Grammar rules should not be triggered on HTML classes
GitOrigin-RevId: 53010d82b8945d0c90a360b201664beabdd8417e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a3a6657b74
commit
61a2df00b5
@@ -8,6 +8,10 @@
|
||||
<H1>Example <TYPO descr="Typo: In word 'hedder'">hedder</TYPO> with <GRAMMAR_ERROR descr="EN_A_VS_AN">a</GRAMMAR_ERROR> error, so what?</H1>\
|
||||
<tag descr="<GRAMMAR_ERROR descr="UPPERCASE_SENTENCE_START">it</GRAMMAR_ERROR> <GRAMMAR_ERROR descr="IT_VBZ">are</GRAMMAR_ERROR> error in tag <TYPO descr="Typo: In word 'atributee'">atributee</TYPO>. And here are some correct English words to make the language detector work."></tag>
|
||||
|
||||
<div class="input-group-text handle">Hello</div>
|
||||
|
||||
<img alt="This is <GRAMMAR_ERROR descr="EN_A_VS_AN">an</GRAMMAR_ERROR> mistake" src="foo.png"/>
|
||||
|
||||
Some widely used comparison methods (e.g. <code>String.compareTo</code>)
|
||||
actually return values.
|
||||
|
||||
|
||||
@@ -227,6 +227,19 @@ public class XmlTextExtractor extends TextExtractor {
|
||||
super(HTMLLanguage.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull List<TextContent> buildTextContents(@NotNull PsiElement element,
|
||||
@NotNull Set<TextContent.TextDomain> 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<XmlTag, TagKind> tagClassifier(@NotNull PsiElement context) {
|
||||
if (!Registry.is("grazie.html.concatenate.inline.tag.contents")) {
|
||||
|
||||
Reference in New Issue
Block a user