mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Unrecognized HTML5 data attributes in Tapestry (IDEA-124505)
This commit is contained in:
@@ -91,7 +91,7 @@ public class Html5CustomAttributeDescriptorsProvider implements XmlAttributeDesc
|
||||
|
||||
@Override
|
||||
public XmlAttributeDescriptor getAttributeDescriptor(String attributeName, XmlTag context) {
|
||||
if (context != null && HtmlUtil.isHtml5Context(context) && HtmlUtil.isCustomHtml5Attribute(attributeName)) {
|
||||
if (context != null && HtmlUtil.isCustomHtml5Attribute(attributeName) && HtmlUtil.tagHasHtml5Schema(context)) {
|
||||
return new AnyXmlAttributeDescriptor(attributeName);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.lang.xhtml.XHTMLLanguage;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -497,6 +498,18 @@ public class HtmlUtil {
|
||||
return "meta.rnc".equals(name);
|
||||
}
|
||||
|
||||
public static boolean tagHasHtml5Schema(@NotNull XmlTag context) {
|
||||
XmlElementDescriptor descriptor = context.getDescriptor();
|
||||
if (descriptor != null) {
|
||||
XmlNSDescriptor nsDescriptor = descriptor.getNSDescriptor();
|
||||
XmlFile descriptorFile = nsDescriptor.getDescriptorFile();
|
||||
String descriptorPath = descriptorFile != null ? descriptorFile.getVirtualFile().getPath() : null;
|
||||
return Comparing.equal(Html5SchemaProvider.getHtml5SchemaLocation(), descriptorPath) ||
|
||||
Comparing.equal(Html5SchemaProvider.getXhtml5SchemaLocation(), descriptorPath);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class TerminateException extends RuntimeException {
|
||||
private static final TerminateException INSTANCE = new TerminateException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user