PsiMetaData (PsiManager psiManager, String text, PsiElement context) { if (context != null && (context.getNode() == null || context.getNode().getElementType() == XmlTokenType.XML_END_TAG_START || context.getParent() instanceof XmlText)) { return null; } String key = StringUtil.toLowerCase(text); final boolean isStdTag = key != null && (MdnDocumentationKt.getHtmlMdnTagDocumentation(MdnApiNamespace.Html, key) != null || MdnDocumentationKt.getHtmlMdnTagDocumentation(MdnApiNamespace.Svg, key) != null || MdnDocumentationKt.getHtmlMdnTagDocumentation(MdnApiNamespace.MathML, key) != null); if (isStdTag && !isAttributeContext(context)) { try { final XmlTag tagFromText = XmlElementFactory.getInstance(psiManager.getProject()).createTagFromText("<" + key + " xmlns=\"" + XmlUtil.XHTML_URI + "\"/>"); return tagFromText.getDescriptor(); } catch (IncorrectOperationException ignore) { } } else { XmlTag tagContext = findTagContext(context); if (tagContext != null) { XmlElementDescriptor tagDescriptor = tagContext.getDescriptor(); return tagDescriptor != null ? tagDescriptor.getAttributeDescriptor(text, tagContext) : null; } } return null; }