Marko v3: Improved handling of invalid attributes

This commit is contained in:
Patrick Steele-Idem 2016-02-11 10:24:41 -07:00
parent fcd2cad02c
commit c78ca5f352
2 changed files with 5 additions and 0 deletions

View File

@ -267,6 +267,10 @@ class CompileContext {
let attrDef = taglibLookup.getAttribute(tagName, attrName);
if (!attrDef) {
if (tagDef) {
if (node.removeAttribute) {
node.removeAttribute(attrName);
}
// var isAttrForTaglib = compiler.taglibs.isTaglib(attrUri);
//Tag doesn't allow dynamic attributes
this.addError({

View File

@ -131,6 +131,7 @@ function buildInputProps(el, context) {
var attrDef = attr.def || context.taglibLookup.getAttribute(el.tagName, attr.name);
if (!attrDef) {
context.addError(el, 'Unsupported attribute of "' + attrName + '" found on the <' + el.tagName + '> custom tag.');
return; // Skip over attributes that are not supported
}