Adding attributes(on the fly) to html

I would like to add attributes to some html tags so that those attributes aren't parsed as invalid attributes. I searched and search but could only find help for implementing auto-completion, but this i got working just fine.

Any ideas ?

Comment actions Permalink

Ok, now i'm feeling stupid. Turns out it wasn't the parser that was showing the error, it was the "Custom html attributes" inspection that was doing it.


Comment actions Permalink


I'm working on a plugin for developing webapplications. The plugin implements new modul types to support usage of different webapplication frameworks. As the 6.0 Idea supports project scope custom html attributes, I want to add some depending on modul types in the project.

For example:
If the project contains a "wicket modul" I want to add "wicket:id" to the custom html attributes. "jwcid" for "tapestry modules" and so on.

I've seen other plugin developers extending the parsing mechanism of xml files, but a simple way to add custom html attributes via plugin would be just fine.

Is there a way to do that?

Thanks in advance!

Comment actions Permalink

Seems, I found the page related to the problem:

Code for registering own XmlNSDescriptor (extends com.intellij.xml.impl.schema.XmlNSDescriptorImpl):

Comment actions Permalink

There is HTML inspection that reports about incorrect tags and attributes (Settings / Errors / HTML Inspections / HTML tags and attributes convention).

If the attribute is added to the custom attributes list of this inspection then IDE don't report that the attribute is incorrect. The code that modifies the custom attributes list:

The question: where is the best place to execute this code? In the file opened listener, on project startup, or another place?


Please sign in to leave a comment.