do not embed js into "on" prefixed unknown attributes

This commit is contained in:
Dennis Ushakov
2014-02-19 17:27:21 +04:00
parent 3886bc21b5
commit c814d70e0c
2 changed files with 4 additions and 2 deletions
@@ -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
@@ -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);
}