diff --git a/xml/xml-psi-impl/src/com/intellij/lexer/BaseHtmlLexer.java b/xml/xml-psi-impl/src/com/intellij/lexer/BaseHtmlLexer.java index c0030d89ff57..23d755a2c250 100644 --- a/xml/xml-psi-impl/src/com/intellij/lexer/BaseHtmlLexer.java +++ b/xml/xml-psi-impl/src/com/intellij/lexer/BaseHtmlLexer.java @@ -25,6 +25,7 @@ import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.TokenSet; import com.intellij.psi.xml.XmlTokenType; import com.intellij.util.text.CharArrayUtil; +import com.intellij.xml.util.documentation.HtmlDescriptorsTable; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -111,7 +112,8 @@ abstract class BaseHtmlLexer extends DelegateLexer { final boolean style = name.equals(TOKEN_STYLE); final int state = getState() & BASE_STATE_MASK; final boolean script = name.equals(TOKEN_SCRIPT) || - ((name.startsWith(TOKEN_ON) && name.indexOf(':') == -1 && !isHtmlTagState(state))); + ((name.startsWith(TOKEN_ON) && name.indexOf(':') == -1 && !isHtmlTagState(state) && + HtmlDescriptorsTable.getAttributeDescriptor(name) != null)); if (style || script) { // encountered tag name in end of tag diff --git a/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java b/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java index ed02f3af1c14..c19805412628 100644 --- a/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java +++ b/xml/xml-psi-impl/src/com/intellij/xml/util/documentation/HtmlDescriptorsTable.java @@ -192,7 +192,7 @@ public class HtmlDescriptorsTable { return ourTagTable.get(tagName); } - static HtmlAttributeDescriptor getAttributeDescriptor(String attributeName) { + public static HtmlAttributeDescriptor getAttributeDescriptor(String attributeName) { return ourAttributeTable.get(attributeName); }